function LocaleExportTest::setUp

Same name in other branches
  1. 9 core/modules/locale/tests/src/Functional/LocaleExportTest.php \Drupal\Tests\locale\Functional\LocaleExportTest::setUp()
  2. 10 core/modules/locale/tests/src/Functional/LocaleExportTest.php \Drupal\Tests\locale\Functional\LocaleExportTest::setUp()
  3. 11.x core/modules/locale/tests/src/Functional/LocaleExportTest.php \Drupal\Tests\locale\Functional\LocaleExportTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/locale/tests/src/Functional/LocaleExportTest.php, line 35

Class

LocaleExportTest
Tests the exportation of locale files.

Namespace

Drupal\Tests\locale\Functional

Code

protected function setUp() {
    parent::setUp();
    $this->adminUser = $this->drupalCreateUser([
        'administer languages',
        'translate interface',
        'access administration pages',
    ]);
    $this->drupalLogin($this->adminUser);
    // Copy test po files to the translations directory.
    \Drupal::service('file_system')->copy(__DIR__ . '/../../../tests/test.de.po', 'translations://', FileSystemInterface::EXISTS_REPLACE);
    \Drupal::service('file_system')->copy(__DIR__ . '/../../../tests/test.xx.po', 'translations://', FileSystemInterface::EXISTS_REPLACE);
}

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