function HelpTest::setUp

Same name in this branch
  1. 11.x core/modules/help/tests/src/Functional/HelpTest.php \Drupal\Tests\help\Functional\HelpTest::setUp()
Same name and namespace in other branches
  1. 10 core/modules/help/tests/src/Functional/HelpTest.php \Drupal\Tests\help\Functional\HelpTest::setUp()
  2. 9 core/modules/help/tests/src/Functional/HelpTest.php \Drupal\Tests\help\Functional\HelpTest::setUp()
  3. 8.9.x core/modules/help/tests/src/Functional/HelpTest.php \Drupal\Tests\help\Functional\HelpTest::setUp()
  4. main core/modules/help/tests/src/Functional/HelpTest.php \Drupal\Tests\help\Functional\HelpTest::setUp()
  5. main core/modules/help/tests/src/Kernel/HelpTest.php \Drupal\Tests\help\Kernel\HelpTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/help/tests/src/Kernel/HelpTest.php, line 65

Class

HelpTest
Verify help display and user access to help based on permissions.

Namespace

Drupal\Tests\help\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this->installEntitySchema('block');
  $this->installEntitySchema('block_content');
  $this->installEntitySchema('user');
  // Create users.
  $this->adminUser = $this->createUser([
    'access help pages',
    'view the administration theme',
    'administer permissions',
  ]);
  $this->anyUser = $this->createUser();
  $this->installConfig('system');
  $this->config('system.site')
    ->set('name', 'Drupal')
    ->save();
  $this->container
    ->get('theme_installer')
    ->install([
    'stark',
  ]);
  $this->config('system.theme')
    ->set('default', 'stark')
    ->save();
  $this->placeBlock('page_title_block');
  $this->placeBlock('help_block');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.