You are here

public function HelpBlockTest::testHelp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/help/tests/src/Functional/HelpBlockTest.php \Drupal\Tests\help\Functional\HelpBlockTest::testHelp()

Logs in users, tests help pages.

File

core/modules/help/tests/src/Functional/HelpBlockTest.php, line 44

Class

HelpBlockTest
Tests display of help block.

Namespace

Drupal\Tests\help\Functional

Code

public function testHelp() {
  $this
    ->drupalGet('help_page_test/has_help');
  $this
    ->assertText(t('I have help!'));
  $this
    ->assertText($this->helpBlock
    ->label());
  $this
    ->drupalGet('help_page_test/no_help');

  // The help block should not appear when there is no help.
  $this
    ->assertNoText($this->helpBlock
    ->label());

  // Ensure that if two hook_help() implementations both return a render array
  // the output is as expected.
  $this
    ->drupalGet('help_page_test/test_array');
  $this
    ->assertText('Help text from more_help_page_test_help module.');
  $this
    ->assertText('Help text from help_page_test_help module.');
}