You are here

public function InstallerTest::testUninstallAndDeletePackageFromLocalRepo in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php \Composer\Installers\Test\InstallerTest::testUninstallAndDeletePackageFromLocalRepo()

File

vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php, line 409

Class

InstallerTest

Namespace

Composer\Installers\Test

Code

public function testUninstallAndDeletePackageFromLocalRepo() {
  $package = new Package('foo', '1.0.0', '1.0.0');
  $installer = $this
    ->getMock('Composer\\Installers\\Installer', array(
    'getInstallPath',
  ), array(
    $this->io,
    $this->composer,
  ));
  $installer
    ->expects($this
    ->once())
    ->method('getInstallPath')
    ->with($package)
    ->will($this
    ->returnValue(sys_get_temp_dir() . '/foo'));
  $repo = $this
    ->getMock('Composer\\Repository\\InstalledRepositoryInterface');
  $repo
    ->expects($this
    ->once())
    ->method('hasPackage')
    ->with($package)
    ->will($this
    ->returnValue(true));
  $repo
    ->expects($this
    ->once())
    ->method('removePackage')
    ->with($package);
  $installer
    ->uninstall($repo, $package);
}