You are here

public function NoHelpTest::testMainPageNoHelp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/help/src/Tests/NoHelpTest.php \Drupal\help\Tests\NoHelpTest::testMainPageNoHelp()

Ensures modules not implementing help do not appear on admin/help.

File

core/modules/help/src/Tests/NoHelpTest.php, line 41
Contains \Drupal\help\Tests\NoHelpTest.

Class

NoHelpTest
Verify no help is displayed for modules not providing any help.

Namespace

Drupal\help\Tests

Code

public function testMainPageNoHelp() {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/help');
  $this
    ->assertResponse(200);
  $this
    ->assertText('Help is available on the following items', 'Help page is found.');
  $this
    ->assertFalse(\Drupal::moduleHandler()
    ->implementsHook('menu_test', 'help'), 'The menu_test module does not implement hook_help');
  $this
    ->assertNoText(\Drupal::moduleHandler()
    ->getName('menu_test'), 'Making sure the test module menu_test does not display a help link on admin/help.');
  $this
    ->drupalGet('admin/help/menu_test');
  $this
    ->assertResponse(404, 'Getting a module overview help page for a module that does not implement hook_help() results in a 404.');
}