function HelpBlockTest::testHelp
Same name in other branches
- 9 core/modules/help/tests/src/Functional/HelpBlockTest.php \Drupal\Tests\help\Functional\HelpBlockTest::testHelp()
- 10 core/modules/help/tests/src/Functional/HelpBlockTest.php \Drupal\Tests\help\Functional\HelpBlockTest::testHelp()
- 11.x 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\FunctionalCode
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.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.