trait ComposerIntegrationTrait in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php \Drupal\Tests\Composer\ComposerIntegrationTrait
Some utility functions for testing the Composer integration.
Hierarchy
- trait \Drupal\Tests\Composer\ComposerIntegrationTrait
2 files declare their use of ComposerIntegrationTrait
- ComposerIntegrationTest.php in core/
tests/ Drupal/ Tests/ ComposerIntegrationTest.php - ComposerValidateTest.php in core/
tests/ Drupal/ BuildTests/ Composer/ ComposerValidateTest.php
File
- core/
tests/ Drupal/ Tests/ Composer/ ComposerIntegrationTrait.php, line 10
Namespace
Drupal\Tests\ComposerView source
trait ComposerIntegrationTrait {
/**
* Get a Finder object to traverse all of the composer.json files in core.
*
* @param string $drupal_root
* Absolute path to the root of the Drupal installation.
*
* @return \Symfony\Component\Finder\Finder
* A Finder object able to iterate all the composer.json files in core.
*/
public function getComposerJsonFinder($drupal_root) {
$composer_json_finder = new Finder();
$composer_json_finder
->name('composer.json')
->in([
// Only find composer.json files within composer/ and core/ directories
// so we don't inadvertently test contrib in local dev environments.
$drupal_root . '/composer',
$drupal_root . '/core',
])
->ignoreUnreadableDirs()
->notPath('#^vendor#')
->notPath('#/fixture#');
return $composer_json_finder;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ComposerIntegrationTrait:: |
public | function | Get a Finder object to traverse all of the composer.json files in core. |