getCodebaseFinder example


  public function copyCodebase(\Iterator $iterator = NULL, $working_dir = NULL) {
    $working_path = $this->getWorkingPath($working_dir);

    if ($iterator === NULL) {
      $iterator = $this->getCodebaseFinder()->getIterator();
    }

    $fs = new SymfonyFilesystem();
    $options = ['override' => TRUE, 'delete' => FALSE];
    $fs->mirror($this->getDrupalRoot()$working_path$iterator$options);
  }

  /** * Get a default Finder object for a Drupal codebase. * * This method can be used two ways: * - Override this method and provide your own default Finder object for * copyCodebase(). * - Call the method to get a default Finder object which can then be * modified for other purposes. * * @return \Symfony\Component\Finder\Finder * A Finder object ready to iterate over core codebase. */
return $data;
  }

  /** * Test whether components' composer.json can be installed in isolation. * * @dataProvider provideComponentPaths */
  public function testComponentComposerJson(string $component_path): void {
    // Only copy the components. Copy all of them because some of them depend on     // each other.     $finder = $this->getCodebaseFinder();
    $finder->in($this->getDrupalRoot() . static::$componentsPath);
    $this->copyCodebase($finder->getIterator());

    $working_dir = $this->getWorkingPath() . static::$componentsPath . $component_path;

    // We add path repositories so we can wire internal dependencies together.     $this->addExpectedRepositories($working_dir);

    // Perform the installation.     $this->executeCommand("composer install --working-dir=$working_dir --no-interaction --no-progress");
    $this->assertCommandSuccessful();
  }
Home | Imprint | This part of the site doesn't use cookies.