1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 01:22:54 +00:00

Merge pull request #3142 from francoispluchino/plugin-load-only-one-time

Register plugin only one time when it's present in global and project mode
This commit is contained in:
Jordi Boggiano 2014-09-30 15:19:55 +01:00
commit 663cda8827
2 changed files with 23 additions and 0 deletions

View file

@ -164,4 +164,21 @@ class PluginInstallerTest extends \PHPUnit_Framework_TestCase
$plugins = $this->pm->getPlugins();
$this->assertEquals('installer-v3', $plugins[1]->version);
}
public function testRegisterPluginOnlyOneTime()
{
$this->repository
->expects($this->exactly(2))
->method('getPackages')
->will($this->returnValue(array()));
$installer = new PluginInstaller($this->io, $this->composer);
$this->pm->loadInstalledPlugins();
$installer->install($this->repository, $this->packages[0]);
$installer->install($this->repository, clone $this->packages[0]);
$plugins = $this->pm->getPlugins();
$this->assertCount(1, $plugins);
$this->assertEquals('installer-v1', $plugins[0]->version);
}
}