You are here

protected function LocaleStringTest::setUp in Language Hierarchy 2.x

Overrides LocaleStringTest::setUp

File

tests/src/Kernel/Core/LocaleStringTest.php, line 29

Class

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

Namespace

Drupal\Tests\language_hierarchy\Kernel\Core

Code

protected function setUp() {

  // We have to skip parent::setUp() here and go straight to the
  // KernelTestBase since parent::setUp() has no way of calling
  // $this->installSchema() prior to the language creation.
  KernelTestBase::setUp();
  $this
    ->installSchema('language_hierarchy', [
    'language_hierarchy_priority',
  ]);

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