summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2015-07-04 16:52:23 +0100
committerxjm2015-07-04 16:52:23 +0100
commitbb4206ade7c7106751a89123b8b15938dc9ea675 (patch)
tree60af2a493dce6d67c6e192bfe347e3d2893e3fc0
parentb73d8872547a0899c9fad1080cb2b792e147b637 (diff)
Issue #2516690 by mlevasseur, joshi.rohit100: Missing test for "Help" links per module on "Extend" admin page
-rw-r--r--core/modules/system/src/Tests/Form/ModulesListFormWebTest.php5
-rw-r--r--core/modules/system/tests/modules/system_test/system_test.module14
2 files changed, 18 insertions, 1 deletions
diff --git a/core/modules/system/src/Tests/Form/ModulesListFormWebTest.php b/core/modules/system/src/Tests/Form/ModulesListFormWebTest.php
index 3600364..489f6ff 100644
--- a/core/modules/system/src/Tests/Form/ModulesListFormWebTest.php
+++ b/core/modules/system/src/Tests/Form/ModulesListFormWebTest.php
@@ -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 @@ class ModulesListFormWebTest extends WebTestBase {
// 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']");
}
}
diff --git a/core/modules/system/tests/modules/system_test/system_test.module b/core/modules/system/tests/modules/system_test/system_test.module
index fb1538d..eef3516 100644
--- a/core/modules/system/tests/modules/system_test/system_test.module
+++ b/core/modules/system/tests/modules/system_test/system_test.module
@@ -1,6 +1,20 @@
<?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().