public function testInstallMultiplePlugins() { $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[3]); $plugins = $this->pm->getPlugins(); $this->assertEquals('plugin1', $plugins[0]->name); $this->assertEquals('installer-v4', $plugins[0]->version); $this->assertEquals('plugin2', $plugins[1]->name); $this->assertEquals('installer-v4', $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); }