You are here

public function HelpPageOrderTest::testHelp in Drupal 9

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

Tests the order of the help page.

File

core/modules/help/tests/src/Functional/HelpPageOrderTest.php, line 53

Class

HelpPageOrderTest
Verify the order of the help page.

Namespace

Drupal\Tests\help\Functional

Code

public function testHelp() {
  $pos = 0;
  $this
    ->drupalGet('admin/help');
  $page_text = $this
    ->getTextContent();
  foreach ($this->stringOrder as $item) {
    $new_pos = strpos($page_text, $item, $pos);
    $this
      ->assertGreaterThan($pos, $new_pos, "Order of {$item} is not correct on help page");
    $pos = $new_pos;
  }
}