class ExperimentalHelpTest
Same name in this branch
- 11.x core/modules/help/tests/src/Functional/ExperimentalHelpTest.php \Drupal\Tests\help\Functional\ExperimentalHelpTest
Same name and namespace in other branches
- 10 core/modules/help/tests/src/Functional/ExperimentalHelpTest.php \Drupal\Tests\help\Functional\ExperimentalHelpTest
- 9 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
- main core/modules/help/tests/src/Functional/ExperimentalHelpTest.php \Drupal\Tests\help\Functional\ExperimentalHelpTest
Verifies help for experimental modules.
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\ExperimentalHelpTest uses \Drupal\Tests\HttpKernelUiHelperTrait, \Drupal\Tests\user\Traits\UserCreationTrait extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of ExperimentalHelpTest
File
-
core/
modules/ help/ tests/ src/ Kernel/ ExperimentalHelpTest.php, line 17
Namespace
Drupal\Tests\help\KernelView source
class ExperimentalHelpTest extends KernelTestBase {
use HttpKernelUiHelperTrait;
use UserCreationTrait;
/**
* Modules to install.
*
* 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',
'user',
'system',
];
/**
* The admin user.
*/
protected UserInterface $adminUser;
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->installEntitySchema('user');
$this->adminUser = $this->createUser([
'access help pages',
]);
$this->setCurrentUser($this->adminUser);
}
/**
* Verifies that a warning message is displayed for experimental modules.
*/
public function testExperimentalHelp() : void {
$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.