Commit bb4206ad authored by xjm's avatar xjm

Issue #2516690 by mlevasseur, joshi.rohit100: Missing test for "Help" links...

Issue #2516690 by mlevasseur, joshi.rohit100: Missing test for "Help" links per module on "Extend" admin page
parent b73d8872
......@@ -19,7 +19,7 @@ class ModulesListFormWebTest extends WebTestBase {
/**
* {@inheritdoc}
*/
public static $modules = array('system_test');
public static $modules = array('system_test', 'help');
/**
* {@inheritdoc}
......@@ -46,6 +46,9 @@ public function testModuleListForm() {
// Check that system_test's permissions link was rendered correctly.
$this->assertFieldByXPath("//a[contains(@href, '/admin/people/permissions#module-system_test') and @title='Configure permissions']");
// Check that system_test's help link was rendered correctly.
$this->assertFieldByXPath("//a[contains(@href, '/admin/help/system_test') and @title='Help']");
}
}
<?php
use Drupal\Core\Extension\Extension;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function system_test_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.system_test':
$output = '';
$output .= '<h3>' . t('Test Help Page') . '</h3>';
$output .= '<p>' . t('This is a test help page for the system_test module for the purpose of testing if the "Help" link displays properly.') . '</p>';
return $output;
}
}
/**
* Implements hook_modules_installed().
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment