function HelpTopicTest::setUp

Same name in other branches
  1. 9 core/modules/help_topics/tests/src/Functional/HelpTopicTest.php \Drupal\Tests\help_topics\Functional\HelpTopicTest::setUp()
  2. 8.9.x core/modules/help_topics/tests/src/Functional/HelpTopicTest.php \Drupal\Tests\help_topics\Functional\HelpTopicTest::setUp()
  3. 10 core/modules/help/tests/src/Functional/HelpTopicTest.php \Drupal\Tests\help\Functional\HelpTopicTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/help/tests/src/Functional/HelpTopicTest.php, line 56

Class

HelpTopicTest
Verifies help topic display and user access to help based on permissions.

Namespace

Drupal\Tests\help\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // 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',
    ]);
    // 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.