public function testUpgradeWithSameClassName()
 {
     $this->repository->expects($this->exactly(3))->method('getPackages')->will($this->returnValue(array($this->packages[1])));
     $this->repository->expects($this->exactly(2))->method('hasPackage')->will($this->onConsecutiveCalls(true, false));
     $installer = new PluginInstaller($this->io, $this->composer);
     $this->pm->loadInstalledPlugins();
     $installer->update($this->repository, $this->packages[1], $this->packages[2]);
     $plugins = $this->pm->getPlugins();
     $this->assertEquals('installer-v3', $plugins[1]->version);
 }