public isInstalled ( Composer\Repository\InstalledRepositoryInterface $repo, Composer\Package\PackageInterface $package ) : boolean | ||
$repo | Composer\Repository\InstalledRepositoryInterface | |
$package | Composer\Package\PackageInterface | |
Результат | boolean |
/** * @param InstalledRepositoryInterface $repo * @param PackageInterface $package * * @return bool */ public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) { if ($package->isDev()) { return $this->symlinkInstaller->isInstalled($repo, $package); } return $this->defaultInstaller->isInstalled($repo, $package); }
/** * @test */ public function isInstalledDevelopment() { $library = new SharedPackageInstaller($this->io, $this->composer, $this->fs, $this->dataManager); $package = $this->createDevelopmentPackageMock(); $this->repository->expects($this->exactly(2))->method('hasPackage')->with($package)->will($this->onConsecutiveCalls(false, true)); $this->assertFalse($library->isInstalled($this->repository, $package)); $this->fs->ensureDirectoryExists($library->getInstallPath($package)); $reflection = new \ReflectionObject($library); $method = $reflection->getMethod('createPackageVendorSymlink'); $method->setAccessible(true); $method->invokeArgs($library, array($package)); $this->assertTrue($library->isInstalled($this->repository, $package)); }