1
0
Fork 0

Add handling for alias operations

pull/685/head
Jordi Boggiano 2012-05-13 22:36:48 +02:00
parent f7d5df2764
commit 46972fbc22
1 changed files with 16 additions and 0 deletions

View File

@ -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;