class HelpPageOrderTest
Same name and namespace in other branches
- 11.x core/modules/help/tests/src/Functional/HelpPageOrderTest.php \Drupal\Tests\help\Functional\HelpPageOrderTest
- 10 core/modules/help/tests/src/Functional/HelpPageOrderTest.php \Drupal\Tests\help\Functional\HelpPageOrderTest
- 8.9.x core/modules/help/tests/src/Functional/HelpPageOrderTest.php \Drupal\Tests\help\Functional\HelpPageOrderTest
Verify the order of the help page.
@group help
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\help\Functional\HelpPageOrderTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of HelpPageOrderTest
File
-
core/
modules/ help/ tests/ src/ Functional/ HelpPageOrderTest.php, line 12
Namespace
Drupal\Tests\help\FunctionalView source
class HelpPageOrderTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'help',
'tour',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Strings to search for on admin/help, in order.
*
* @var string[]
*/
protected $stringOrder = [
'Module overviews are provided',
'Tours guide you',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
// Create and log in user.
$account = $this->drupalCreateUser([
'access administration pages',
'view the administration theme',
'administer permissions',
'access tour',
]);
$this->drupalLogin($account);
}
/**
* Tests the order of the help page.
*/
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;
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.