function BuildTestBase::getCodebaseFinder
Same name and namespace in other branches
- 11.x core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::getCodebaseFinder()
- 10 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::getCodebaseFinder()
- 9 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::getCodebaseFinder()
- 8.9.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.
Note that the vendor directory is deliberately not included in the directory exclusions here, so that packages are copied and composer does not attempt to download them from packagist/github during test runs.
Return value
\Symfony\Component\Finder\Finder A Finder object ready to iterate over core codebase.
3 calls to BuildTestBase::getCodebaseFinder()
- ComponentsTaggedReleaseTest::testReleaseTagging in core/
tests/ Drupal/ BuildTests/ Composer/ Component/ ComponentsTaggedReleaseTest.php - Validate release tagging and regeneration of dependencies.
- GenerateThemeTest::setUp in core/
tests/ Drupal/ BuildTests/ Command/ GenerateThemeTest.php - TemplateProjectTestBase::createTestProject in core/
modules/ package_manager/ tests/ src/ Build/ TemplateProjectTestBase.php - Creates a test project from a given template and installs Drupal.
File
-
core/
tests/ Drupal/ BuildTests/ Framework/ BuildTestBase.php, line 572
Class
- BuildTestBase
- Provides a workspace to test build processes.
Namespace
Drupal\BuildTests\FrameworkCode
public function getCodebaseFinder() : Finder {
$drupal_root = $this->getWorkingPathDrupalRoot() ?? '';
$finder = new Finder();
$finder->files()
->followLinks()
->ignoreUnreadableDirs()
->in($this->getComposerRoot())
->notPath("#^{$drupal_root}sites/default/files#")
->notPath("#^{$drupal_root}sites/simpletest#")
->notPath("#^{$drupal_root}core/node_modules#")
->notPath("#^{$drupal_root}core/phpstan-tmp#")
->notPath("#^{$drupal_root}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.