Skip to content
Snippets Groups Projects
Commit c680d33d authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2495657 by alexpott, jhodgdon: Admin links are missing from a module's help page

parent 12faec88
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -137,7 +137,8 @@ public function helpPage($name) {
$link['title'] = $task['title'];
$links[] = $link;
}
$build['links']['#links'] = array(
$build['links'] = array(
'#theme' => 'links__help',
'#heading' => array(
'level' => 'h3',
'text' => $this->t('@module administration pages', array('@module' => $module_name)),
......
......@@ -50,8 +50,9 @@ protected function setUp() {
* Logs in users, creates dblog events, and tests dblog functionality.
*/
public function testHelp() {
// Login the admin user.
$this->drupalLogin($this->adminUser);
// Login the root user to ensure as many admin links appear as possible on
// the module overview pages.
$this->drupalLogin($this->rootUser);
$this->verifyHelp();
// Login the regular user.
......@@ -95,6 +96,13 @@ protected function verifyHelp($response = 200) {
if ($response == 200) {
$this->assertTitle($name . ' | Drupal', format_string('%module title was displayed', array('%module' => $module)));
$this->assertRaw('<h1 class="page-title">' . t($name) . '</h1>', format_string('%module heading was displayed', array('%module' => $module)));
$admin_tasks = system_get_module_admin_tasks($module, system_get_info('module', $module));
if (!empty($admin_tasks)) {
$this->assertText(t('@module administration pages', array('@module' => $name)));
}
foreach ($admin_tasks as $task) {
$this->assertLink($task['title']);
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment