function HelpTopicTranslatedTestBase::setUp

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

Overrides BrowserTestBase::setUp

2 calls to HelpTopicTranslatedTestBase::setUp()
HelpTopicSearchTest::setUp in core/modules/help/tests/src/Functional/HelpTopicSearchTest.php
HelpTopicTranslationTest::setUp in core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php
2 methods override HelpTopicTranslatedTestBase::setUp()
HelpTopicSearchTest::setUp in core/modules/help/tests/src/Functional/HelpTopicSearchTest.php
HelpTopicTranslationTest::setUp in core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php

File

core/modules/help/tests/src/Functional/HelpTopicTranslatedTestBase.php, line 31

Class

HelpTopicTranslatedTestBase
Provides a base class for functional help topic tests that use translation.

Namespace

Drupal\Tests\help\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // These tests rely on some markup from the 'Claro' theme, as well as an
    // optional block added when Claro is enabled.
    \Drupal::service('theme_installer')->install([
        'claro',
    ]);
    \Drupal::configFactory()->getEditable('system.theme')
        ->set('admin', 'claro')
        ->save(TRUE);
    // Place various blocks.
    $settings = [
        'theme' => 'claro',
        '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);
    // Create user.
    $this->drupalLogin($this->createUser([
        'access help pages',
        'view the administration theme',
        'administer permissions',
    ]));
}

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