You are here

protected function LocaleConfigSubscriberTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/Tests/LocaleConfigSubscriberTest.php \Drupal\locale\Tests\LocaleConfigSubscriberTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

core/modules/locale/src/Tests/LocaleConfigSubscriberTest.php, line 59
Contains \Drupal\locale\Tests\LocaleConfigSubscriberTest.

Class

LocaleConfigSubscriberTest
Tests that shipped configuration translations are updated correctly.

Namespace

Drupal\locale\Tests

Code

protected function setUp() {
  parent::setUp();
  $this
    ->setUpDefaultLanguage();
  $this
    ->installSchema('locale', [
    'locales_source',
    'locales_target',
    'locales_location',
  ]);
  $this
    ->installSchema('system', [
    'queue',
  ]);
  $this
    ->setupLanguages();
  $this
    ->enableModules([
    'locale_test',
  ]);
  $this
    ->installConfig([
    'locale_test',
  ]);

  // Simulate this hook invoked which would happen if in a non-kernel test
  // or normal environment.
  // @see locale_modules_installed()
  // @see locale_system_update()
  locale_system_set_config_langcodes();
  $langcodes = array_keys(\Drupal::languageManager()
    ->getLanguages());
  $names = \Drupal\locale\Locale::config()
    ->getComponentNames();
  Locale::config()
    ->updateConfigTranslations($names, $langcodes);
  $this->configFactory = $this->container
    ->get('config.factory');
  $this->stringStorage = $this->container
    ->get('locale.storage');
  $this->localeConfigManager = $this->container
    ->get('locale.config_manager');
  $this->languageManager = $this->container
    ->get('language_manager');
  $this
    ->setUpLocale();
}