class ExperimentalHelpTest
Same name and namespace in other branches
- 11.x core/modules/help/tests/src/Functional/ExperimentalHelpTest.php \Drupal\Tests\help\Functional\ExperimentalHelpTest
- 10 core/modules/help/tests/src/Functional/ExperimentalHelpTest.php \Drupal\Tests\help\Functional\ExperimentalHelpTest
- 8.9.x core/modules/help/tests/src/Functional/ExperimentalHelpTest.php \Drupal\Tests\help\Functional\ExperimentalHelpTest
Verifies help for experimental modules.
@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\ExperimentalHelpTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of ExperimentalHelpTest
File
-
core/
modules/ help/ tests/ src/ Functional/ ExperimentalHelpTest.php, line 12
Namespace
Drupal\Tests\help\FunctionalView source
class ExperimentalHelpTest extends BrowserTestBase {
/**
* Modules to enable.
*
* The experimental_module_test module implements hook_help() and is in the
* Core (Experimental) package.
*
* @var array
*/
protected static $modules = [
'help',
'experimental_module_test',
'help_page_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* The admin user.
*
* @var \Drupal\user\UserInterface
*/
protected $adminUser;
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser([
'access administration pages',
]);
}
/**
* Verifies that a warning message is displayed for experimental modules.
*/
public function testExperimentalHelp() {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/help/experimental_module_test');
$this->assertSession()
->statusMessageContains('This module is experimental.', 'warning');
// Regular modules should not display the message.
$this->drupalGet('admin/help/help_page_test');
$this->assertSession()
->statusMessageNotContains('This module is experimental.');
// Ensure the actual help page is displayed to avoid a false positive.
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->pageTextContains('online documentation for the Help Page Test module');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.