You are here

protected function InstallUninstallTest::assertHelp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php \Drupal\Tests\system\Functional\Module\InstallUninstallTest::assertHelp()
  2. 9 core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php \Drupal\Tests\system\Functional\Module\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\Module

Code

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}");
}