function LocaleStringTest::setUp

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

Overrides KernelTestBase::setUp

File

core/modules/locale/tests/src/Kernel/LocaleStringTest.php, line 36

Class

LocaleStringTest
Tests the locale string storage, string objects and data API.

Namespace

Drupal\Tests\locale\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    // Add a default locale storage for all these tests.
    $this->storage = $this->container
        ->get('locale.storage');
    // Create two languages: Spanish and German.
    foreach ([
        'es',
        'de',
    ] as $langcode) {
        ConfigurableLanguage::createFromLangcode($langcode)->save();
    }
    $this->installSchema('locale', [
        'locales_location',
        'locales_source',
        'locales_target',
    ]);
}

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