You are here

public function BuildTestBase::getCodebaseFinder in Drupal 9

Same name and namespace in other branches
  1. 8 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 567

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;
}