From 46972fbc226397d6c54a02c38e5b92fd17cb0578 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 13 May 2012 22:36:48 +0200 Subject: [PATCH] Add handling for alias operations --- .../Test/Mock/InstallationManagerMock.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/Composer/Test/Mock/InstallationManagerMock.php b/tests/Composer/Test/Mock/InstallationManagerMock.php index 6474d1637..88724a7a5 100644 --- a/tests/Composer/Test/Mock/InstallationManagerMock.php +++ b/tests/Composer/Test/Mock/InstallationManagerMock.php @@ -17,6 +17,8 @@ use Composer\DependencyResolver\Operation\OperationInterface; use Composer\DependencyResolver\Operation\InstallOperation; use Composer\DependencyResolver\Operation\UpdateOperation; use Composer\DependencyResolver\Operation\UninstallOperation; +use Composer\DependencyResolver\Operation\MarkAliasInstalledOperation; +use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation; class InstallationManagerMock extends InstallationManager { @@ -47,6 +49,20 @@ class InstallationManagerMock extends InstallationManager $repo->removePackage($operation->getPackage()); } + public function markAliasInstalled(RepositoryInterface $repo, MarkAliasInstalledOperation $operation) + { + $this->installed[] = $operation->getPackage(); + $this->trace[] = (string) $operation; + $repo->addPackage(clone $operation->getPackage()); + } + + public function markAliasUninstalled(RepositoryInterface $repo, MarkAliasUninstalledOperation $operation) + { + $this->uninstalled[] = $operation->getPackage(); + $this->trace[] = (string) $operation; + $repo->removePackage($operation->getPackage()); + } + public function getTrace() { return $this->trace;