getPathsForPackage example


  protected function removeBinBeforeCleanup(BasePackage $package) {
    // We can process AliasPackage and Package objects, and they share the     // BasePackage parent class. However, since there is no common interface for     // these package types that allow for the setBinaries() method, and since     // BasePackage does not include the setBinaries() method, we have to make     // sure we're processing a class with a setBinaries() method.     if (!method_exists($package, 'setBinaries')) {
      return;
    }
    $binaries = $package->getBinaries();
    $clean_paths = $this->config->getPathsForPackage($package->getName());
    // Only do this if there are binaries and cleanup paths.     if (!$binaries || !$clean_paths) {
      return;
    }
    if ($unset_these_binaries = $this->findBinOverlap($binaries$clean_paths)) {
      $this->io->writeError(
        sprintf('%sModifying bin config for <info>%s</info> which overlaps with cleanup directories.', str_repeat(' ', 4)$package->getName()),
        TRUE,
        IOInterface::VERBOSE
      );
      $modified_binaries = [];
      

  public function testGetPathsForPackageMixedCase() {
    $config = $this->getMockBuilder(Config::class)
      ->onlyMethods(['getAllCleanupPaths'])
      ->disableOriginalConstructor()
      ->getMock();

    $config->expects($this->once())
      ->method('getAllCleanupPaths')
      ->willReturn(['package' => ['path']]);

    $this->assertSame(['path']$config->getPathsForPackage('pACKage'));
  }

  /** * @covers ::getAllCleanupPaths */
  public function testNoRootMergeConfig() {
    // Root package has no extra field.     $root = $this->getMockBuilder(RootPackageInterface::class)
      ->onlyMethods(['getExtra'])
      ->getMockForAbstractClass();
    $root->expects($this->once())
      
Home | Imprint | This part of the site doesn't use cookies.