function InstallUninstallTest::assertHelp
Verifies a module's help.
Verifies that the module help page from hook_help() exists and can be displayed, and that it contains the phrase "Foo Bar module", where "Foo Bar" is the name of the module from the .info.yml file.
@internal
Parameters
string $module: Machine name of the module to verify.
string $name: Human-readable name of the module to verify.
1 call to InstallUninstallTest::assertHelp()
- InstallUninstallTest::testInstallUninstall in core/
modules/ system/ tests/ src/ Functional/ Module/ InstallUninstallTest.php  - Tests that a fixed set of modules can be installed and uninstalled.
 
File
- 
              core/
modules/ system/ tests/ src/ Functional/ Module/ InstallUninstallTest.php, line 409  
Class
- InstallUninstallTest
 - Install/uninstall core module and confirm table creation/deletion.
 
Namespace
Drupal\Tests\system\Functional\ModuleCode
protected function assertHelp(string $module, string $name) : void {
  $this->drupalGet('admin/help/' . $module);
  $this->assertSession()
    ->statusCodeEquals(200);
  $this->assertSession()
    ->pageTextContains($name . ' module');
  $this->assertSession()
    ->linkExists('online documentation for the ' . $name . ' module', 0, "Correct online documentation link is in the help page for {$module}");
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.