You are here

protected function HelpTopicTranslatedTestBase::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php \Drupal\Tests\help_topics\Functional\HelpTopicTranslatedTestBase::setUp()
  2. 9 core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php \Drupal\Tests\help_topics\Functional\HelpTopicTranslatedTestBase::setUp()

File

core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php, line 30

Class

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

Namespace

Drupal\Tests\help_topics\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 administration pages',
    'view the administration theme',
    'administer permissions',
  ]));
}