You are here

protected function TranslatedViewTest::setUp in Drupal 10

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

File

core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php, line 45

Class

TranslatedViewTest
Tests that translated strings in views UI don't override original strings.

Namespace

Drupal\Tests\views_ui\Functional

Code

protected function setUp($import_test_views = TRUE, $modules = []) : void {
  parent::setUp($import_test_views, $modules);
  $permissions = [
    'administer site configuration',
    'administer views',
    'translate configuration',
    'translate interface',
  ];

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

  // Add languages.
  foreach ($this->langcodes as $langcode) {
    ConfigurableLanguage::createFromLangcode($langcode)
      ->save();
  }
  $this
    ->resetAll();
  $this
    ->rebuildContainer();
}