You are here

protected function TestDiscovery::getExtensions in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Test/TestDiscovery.php \Drupal\Core\Test\TestDiscovery::getExtensions()

Returns all available extensions.

Return value

\Drupal\Core\Extension\Extension[] An array of Extension objects, keyed by extension name.

1 call to TestDiscovery::getExtensions()
TestDiscovery::registerTestNamespaces in core/lib/Drupal/Core/Test/TestDiscovery.php
Registers test namespaces of all extensions and core test classes.

File

core/lib/Drupal/Core/Test/TestDiscovery.php, line 486

Class

TestDiscovery
Discovers available tests.

Namespace

Drupal\Core\Test

Code

protected function getExtensions() {
  $listing = new ExtensionDiscovery($this->root);

  // Ensure that tests in all profiles are discovered.
  $listing
    ->setProfileDirectories([]);
  $extensions = $listing
    ->scan('module', TRUE);
  $extensions += $listing
    ->scan('profile', TRUE);
  $extensions += $listing
    ->scan('theme', TRUE);
  return $extensions;
}