function ComposerIntegrationTrait::getComposerJsonFinder

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php \Drupal\Tests\Composer\ComposerIntegrationTrait::getComposerJsonFinder()
  2. 8.9.x core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php \Drupal\Tests\Composer\ComposerIntegrationTrait::getComposerJsonFinder()
  3. 10 core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php \Drupal\Tests\Composer\ComposerIntegrationTrait::getComposerJsonFinder()

Get a Finder object to traverse all of the composer.json files in core.

Parameters

string $drupal_root: Absolute path to the root of the Drupal installation.

Return value

\Symfony\Component\Finder\Finder A Finder object able to iterate all the composer.json files in core.

2 calls to ComposerIntegrationTrait::getComposerJsonFinder()
ComposerIntegrationTest::providerTestComposerJson in core/tests/Drupal/Tests/ComposerIntegrationTest.php
Data provider for all the composer.json provided by Drupal core.
ComposerValidateTest::provideComposerJson in core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php

File

core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php, line 23

Class

ComposerIntegrationTrait
Some utility functions for testing the Composer integration.

Namespace

Drupal\Tests\Composer

Code

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

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