public install ( Composer\Repository\InstalledRepositoryInterface $repo, Composer\Package\PackageInterface $package ) | ||
$repo | Composer\Repository\InstalledRepositoryInterface | |
$package | Composer\Package\PackageInterface |
/** * @param InstalledRepositoryInterface $repo * @param PackageInterface $package */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { if ($package->isDev()) { $this->symlinkInstaller->install($repo, $package); } else { $this->defaultInstaller->install($repo, $package); } }
/** * @test * * @depends installDevelopment */ public function installDevelopmentAndSymlinkDisabled() { /** @var RootPackage|\PHPUnit_Framework_MockObject_MockObject $rootPackage */ $rootPackage = $this->getMock('Composer\\Package\\RootPackageInterface'); $rootPackage->expects($this->any())->method('getExtra')->willReturn(array(SharedPackageInstaller::PACKAGE_TYPE => array('vendor-dir' => $this->dependenciesDir, 'symlink-dir' => $this->symlinkDir, 'symlink-enabled' => false))); $this->composer->setPackage($rootPackage); $library = new SharedPackageInstaller($this->io, $this->composer, $this->fs, $this->dataManager); $package = $this->createDevelopmentPackageMock(); $library->install($this->repository, $package); $this->assertFileNotExists($this->symlinkDir, 'Symlink dir should be created'); }