From 9346d4a501edaa9eb1217fafd08944d197ea37c9 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 1 Jul 2012 18:41:58 +0200 Subject: [PATCH] Make the InstallationManagerMock behave like the real class on alias install --- tests/Composer/Test/Mock/InstallationManagerMock.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Composer/Test/Mock/InstallationManagerMock.php b/tests/Composer/Test/Mock/InstallationManagerMock.php index 4bccc63f8..b643df728 100644 --- a/tests/Composer/Test/Mock/InstallationManagerMock.php +++ b/tests/Composer/Test/Mock/InstallationManagerMock.php @@ -56,9 +56,14 @@ class InstallationManagerMock extends InstallationManager public function markAliasInstalled(RepositoryInterface $repo, MarkAliasInstalledOperation $operation) { - $this->installed[] = $operation->getPackage(); + $package = $operation->getPackage(); + + $this->installed[] = $package; $this->trace[] = (string) $operation; - $repo->addPackage(clone $operation->getPackage()); + + if (!$repo->hasPackage($package)) { + $repo->addPackage($package); + } } public function markAliasUninstalled(RepositoryInterface $repo, MarkAliasUninstalledOperation $operation)