You are here

protected function LocaleStringTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 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 34

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',
  ]);
}