From 76c381ae2dfeb3b6884fb381c4a080a7f5a562ca Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 21 Jul 2009 02:01:08 +0000 Subject: #295983 by naxoc and lilou: Add test for modules that do not implement hook_help(). --- modules/help/help.test | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'modules/help') diff --git a/modules/help/help.test b/modules/help/help.test index 7351650dd..de0ddfa6c 100644 --- a/modules/help/help.test +++ b/modules/help/help.test @@ -85,5 +85,36 @@ class HelpTestCase extends DrupalWebTestCase { $this->modules[$module->name] = $fullname['name']; } } + } +} + +/** + * Tests module without help to verify it is not listed in help page. + */ +class NoHelpTestCase extends DrupalWebTestCase { + protected $big_user; + + public static function getInfo() { + return array( + 'name' => 'No help', + 'description' => 'Verify no help is displayed for modules not providing any help.', + 'group' => 'Help', + ); + } + + function setUp() { + // Use one of the test modules that do not implement hook_help(). + parent::setUp('menu_test'); + $this->big_user = $this->drupalCreateUser(array('access administration pages')); + } + + /** + * Ensure modules not implementing help do not appear on admin/help. + */ + function testMainPageNoHelp() { + $this->drupalLogin($this->big_user); + + $this->drupalGet('admin/help'); + $this->assertNoText('Hook menu tests', t('Making sure the test module menu_test does not display a help link in admin/help')); } } -- cgit v1.2.3