function LocaleUpdateTest::setUp

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

Overrides LocaleUpdateBase::setUp

File

core/modules/locale/tests/src/Functional/LocaleUpdateTest.php, line 23

Class

LocaleUpdateTest
Tests for updating the interface translations of projects.

Namespace

Drupal\Tests\locale\Functional

Code

protected function setUp() : void {
    parent::setUp();
    $module_handler = \Drupal::moduleHandler();
    $module_handler->loadInclude('locale', 'inc', 'locale.compare');
    $module_handler->loadInclude('locale', 'inc', 'locale.fetch');
    $admin_user = $this->drupalCreateUser([
        'administer modules',
        'administer site configuration',
        'administer languages',
        'access administration pages',
        'translate interface',
    ]);
    $this->drupalLogin($admin_user);
    // We use German as test language. This language must match the translation
    // file that come with the locale_test module (test.de.po) and can therefore
    // not be chosen randomly.
    $this->addLanguage('de');
}

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