You are here

protected function ConfigTranslationOverviewTest::setUp in Drupal 9

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

Overrides BrowserTestBase::setUp

File

core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php, line 57

Class

ConfigTranslationOverviewTest
Translate settings and entities to various languages.

Namespace

Drupal\Tests\config_translation\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $permissions = [
    'translate configuration',
    'administer languages',
    'administer site configuration',
    'administer contact forms',
    'access site-wide contact form',
    'access contextual links',
    'administer views',
  ];

  // Create and log in user.
  $this
    ->drupalLogin($this
    ->drupalCreateUser($permissions));

  // Add languages.
  foreach ($this->langcodes as $langcode) {
    ConfigurableLanguage::createFromLangcode($langcode)
      ->save();
  }
  $this->localeStorage = $this->container
    ->get('locale.storage');
  $this
    ->drupalPlaceBlock('local_tasks_block');
  $this
    ->drupalPlaceBlock('page_title_block');
}