function LocaleLocaleLookupTest::setUp

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

Overrides BrowserTestBase::setUp

File

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

Class

LocaleLocaleLookupTest
Tests LocaleLookup.

Namespace

Drupal\Tests\locale\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // The \Drupal\locale\LocaleTranslation service stores localization cache
    // data after the response is flushed to the client. We do not want to race
    // with any string translations that may be saving from the login below.
    $this->setWaitForTerminate();
    // Change the language default object to different values.
    ConfigurableLanguage::createFromLangcode('fr')->save();
    $this->config('system.site')
        ->set('default_langcode', 'fr')
        ->save();
    $this->drupalLogin($this->drupalCreateUser([
        'administer modules',
    ]));
}

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