function TestSuiteBase::findExtensionDirectories

Same name in other branches
  1. 8.9.x core/tests/TestSuites/TestSuiteBase.php \Drupal\Tests\TestSuites\TestSuiteBase::findExtensionDirectories()
  2. 10 core/tests/TestSuites/TestSuiteBase.php \Drupal\Tests\TestSuites\TestSuiteBase::findExtensionDirectories()
  3. 11.x core/tests/TestSuites/TestSuiteBase.php \Drupal\Tests\TestSuites\TestSuiteBase::findExtensionDirectories()

Finds extensions in a Drupal installation.

An extension is defined as a directory with an *.info.yml file in it.

Parameters

string $root: Path to the root of the Drupal installation.

Return value

string[] Associative array of extension paths, with extension name as keys.

1 call to TestSuiteBase::findExtensionDirectories()
TestSuiteBase::addTestsBySuiteNamespace in core/tests/TestSuites/TestSuiteBase.php
Find and add tests to the suite for core and any extensions.
1 method overrides TestSuiteBase::findExtensionDirectories()
StubTestSuiteBase::findExtensionDirectories in core/tests/Drupal/Tests/Core/Test/TestSuiteBaseTest.php
Finds extensions in a Drupal installation.

File

core/tests/TestSuites/TestSuiteBase.php, line 24

Class

TestSuiteBase
Base class for Drupal test suites.

Namespace

Drupal\Tests\TestSuites

Code

protected function findExtensionDirectories($root) {
    $extension_roots = \drupal_phpunit_contrib_extension_directory_roots($root);
    $extension_directories = array_map('drupal_phpunit_find_extension_directories', $extension_roots);
    return array_reduce($extension_directories, 'array_merge', []);
}

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