You are here

protected function HelpTest::getModuleList in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/help/tests/src/Functional/HelpTest.php \Drupal\Tests\help\Functional\HelpTest::getModuleList()
  2. 9 core/modules/help/tests/src/Functional/HelpTest.php \Drupal\Tests\help\Functional\HelpTest::getModuleList()

Gets the list of enabled modules that implement hook_help().

Return value

array A list of enabled modules.

File

core/modules/help/tests/src/Functional/HelpTest.php, line 164

Class

HelpTest
Verify help display and user access to help based on permissions.

Namespace

Drupal\Tests\help\Functional

Code

protected function getModuleList() {
  $modules = [];
  $module_data = $this->container
    ->get('extension.list.module')
    ->getList();
  \Drupal::moduleHandler()
    ->invokeAllWith('help', function (callable $hook, string $module) use (&$modules, $module_data) {
    $modules[$module] = $module_data[$module]->info['name'];
  });
  return $modules;
}