function HelpTest::getModuleList

Same name in other branches
  1. 9 core/modules/help/tests/src/Functional/HelpTest.php \Drupal\Tests\help\Functional\HelpTest::getModuleList()
  2. 10 core/modules/help/tests/src/Functional/HelpTest.php \Drupal\Tests\help\Functional\HelpTest::getModuleList()
  3. 11.x 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.

2 calls to HelpTest::getModuleList()
HelpTest::testHelp in core/modules/help/tests/src/Functional/HelpTest.php
Logs in users, tests help pages.
HelpTest::verifyHelp in core/modules/help/tests/src/Functional/HelpTest.php
Verifies the logged in user has access to the various help pages.

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();
    foreach (\Drupal::moduleHandler()->getImplementations('help') as $module) {
        $modules[$module] = $module_data[$module]->info['name'];
    }
    return $modules;
}

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