class SearchHelpHelpPageTest
Same name and namespace in other branches
- 11.x core/modules/search/modules/search_help/tests/src/Functional/SearchHelpHelpPageTest.php \Drupal\Tests\search_help\Functional\SearchHelpHelpPageTest
Verifies that search_help extends the main help page.
Attributes
#[Group('help')]
#[RunTestsInSeparateProcesses]
Hierarchy
- class \Drupal\Tests\DrupalTestCase uses \Drupal\Tests\DrupalTestCaseTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\ExtensionListTestTrait extends \Drupal\Tests\DrupalTestCase
- class \Drupal\Tests\search_help\Functional\SearchHelpHelpPageTest extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\ExtensionListTestTrait extends \Drupal\Tests\DrupalTestCase
Expanded class hierarchy of SearchHelpHelpPageTest
File
-
core/
modules/ search/ modules/ search_help/ tests/ src/ Functional/ SearchHelpHelpPageTest.php, line 14
Namespace
Drupal\Tests\search_help\FunctionalView source
class SearchHelpHelpPageTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'help',
'search',
'search_help',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests that the help search section is added to and removed from the page.
*/
public function testHelpPages() : void {
$this->drupalLogin($this->createUser([
'access help pages',
]));
// Confirm that search_help does not expose its own help page.
$this->drupalGet('admin/help/search_help');
$this->assertSession()
->statusCodeEquals(404);
$session = $this->assertSession();
$this->drupalGet('admin/help/help');
$session->statusCodeEquals(200);
$session->pageTextContains('Configuring help search');
$session->pageTextContains('Translating help topics');
// Uninstalling search_help should remove the section but keep the
// original help module output.
\Drupal::service('module_installer')->uninstall([
'search_help',
]);
$this->resetAll();
$this->drupalGet('admin/help/help');
$session->statusCodeEquals(200);
$session->pageTextNotContains('Configuring help search');
$session->pageTextContains('Translating help topics');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.