function BuildTestBase::getCodebaseFinder

Same name and namespace in other branches
  1. 9 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::getCodebaseFinder()
  2. 10 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::getCodebaseFinder()
  3. 11.x core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::getCodebaseFinder()

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 value

\Symfony\Component\Finder\Finder A Finder object ready to iterate over core codebase.

File

core/tests/Drupal/BuildTests/Framework/BuildTestBase.php, line 572

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

public function getCodebaseFinder() {
    $finder = new Finder();
    $finder->files()
        ->ignoreUnreadableDirs()
        ->in($this->getDrupalRoot())
        ->notPath('#^sites/default/files#')
        ->notPath('#^sites/simpletest#')
        ->notPath('#^vendor#')
        ->notPath('#^sites/default/settings\\..*php#')
        ->ignoreDotFiles(FALSE)
        ->ignoreVCS(FALSE);
    return $finder;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.