class HelpPageOrderTest
Same name in this branch
- 11.x core/modules/help/tests/src/Functional/HelpPageOrderTest.php \Drupal\Tests\help\Functional\HelpPageOrderTest
Same name and namespace in other branches
- 10 core/modules/help/tests/src/Functional/HelpPageOrderTest.php \Drupal\Tests\help\Functional\HelpPageOrderTest
- 9 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
- main core/modules/help/tests/src/Functional/HelpPageOrderTest.php \Drupal\Tests\help\Functional\HelpPageOrderTest
Verify the order of the help page.
Attributes
#[Group('help')]
#[RunTestsInSeparateProcesses]
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\Tests\DrupalTestCaseTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait, \Drupal\Tests\BrowserHtmlDebugTrait, \Drupal\Tests\HttpKernelUiHelperTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\help\Kernel\HelpPageOrderTest uses \Drupal\Tests\HttpKernelUiHelperTrait, \Drupal\Tests\user\Traits\UserCreationTrait extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of HelpPageOrderTest
File
-
core/
modules/ help/ tests/ src/ Kernel/ HelpPageOrderTest.php, line 16
Namespace
Drupal\Tests\help\KernelView source
class HelpPageOrderTest extends KernelTestBase {
use HttpKernelUiHelperTrait;
use UserCreationTrait;
/**
* {@inheritdoc}
*/
protected static $modules = [
'help',
'help_page_test',
'system',
'user',
];
/**
* Strings to search for on admin/help, in order.
*
* @var string[]
*/
protected array $stringOrder = [
'Module overviews are provided',
'This description should appear',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->installEntitySchema('user');
// Create and log in user.
$account = $this->createUser([
'access help pages',
]);
$this->setCurrentUser($account);
}
/**
* Tests the order of the help page.
*/
public function testHelp() : void {
$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.