function HelpTopicTest::setUp
Same name in this branch
- 11.x core/modules/help/tests/src/Functional/HelpTopicTest.php \Drupal\Tests\help\Functional\HelpTopicTest::setUp()
Same name and namespace in other branches
- 10 core/modules/help/tests/src/Functional/HelpTopicTest.php \Drupal\Tests\help\Functional\HelpTopicTest::setUp()
- 9 core/modules/help_topics/tests/src/Functional/HelpTopicTest.php \Drupal\Tests\help_topics\Functional\HelpTopicTest::setUp()
- 8.9.x core/modules/help_topics/tests/src/Functional/HelpTopicTest.php \Drupal\Tests\help_topics\Functional\HelpTopicTest::setUp()
- main core/modules/help/tests/src/Functional/HelpTopicTest.php \Drupal\Tests\help\Functional\HelpTopicTest::setUp()
- main core/modules/help/tests/src/Kernel/HelpTopicTest.php \Drupal\Tests\help\Kernel\HelpTopicTest::setUp()
Overrides KernelTestBase::setUp
File
-
core/
modules/ help/ tests/ src/ Kernel/ HelpTopicTest.php, line 72
Class
- HelpTopicTest
- Verifies help topic display and user access to help based on permissions.
Namespace
Drupal\Tests\help\KernelCode
protected function setUp() : void {
parent::setUp();
$this->installEntitySchema('path_alias');
$this->installEntitySchema('user');
$this->installSchema('user', [
'users_data',
]);
$this->installConfig('system');
$this->config('system.site')
->set('name', 'Drupal')
->save();
// These tests rely on some markup from the 'stark' theme and we test theme
// provided help topics.
\Drupal::service('theme_installer')->install([
'help_topics_test_theme',
'stark',
]);
$this->config('system.theme')
->set('default', 'stark')
->save();
// Place various blocks.
$settings = [
'theme' => 'stark',
'region' => 'help',
];
$this->placeBlock('help_block', $settings);
$this->placeBlock('local_tasks_block', $settings);
$this->placeBlock('local_actions_block', $settings);
$this->placeBlock('page_title_block', $settings);
$this->placeBlock('system_breadcrumb_block', $settings);
// Create users.
$this->adminUser = $this->createUser([
'access administration pages',
'access help pages',
'view the administration theme',
'administer permissions',
'administer site configuration',
'access test help',
]);
$this->noTestUser = $this->createUser([
'access help pages',
'view the administration theme',
'administer permissions',
'administer site configuration',
]);
$this->anyUser = $this->createUser();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.