You are here

public function LanguageConfigOverrideInstallTest::testLanguageConfigOverrideInstall in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/src/Tests/LanguageConfigOverrideInstallTest.php \Drupal\language\Tests\LanguageConfigOverrideInstallTest::testLanguageConfigOverrideInstall()

Tests the configuration events are not fired during install of overrides.

File

core/modules/language/src/Tests/LanguageConfigOverrideInstallTest.php, line 29
Contains \Drupal\language\Tests\LanguageConfigOverrideInstallTest.

Class

LanguageConfigOverrideInstallTest
Ensures the language config overrides can be installed.

Namespace

Drupal\language\Tests

Code

public function testLanguageConfigOverrideInstall() {
  ConfigurableLanguage::createFromLangcode('de')
    ->save();

  // Need to enable test module after creating the language otherwise saving
  // the language will install the configuration.
  $this
    ->enableModules(array(
    'language_config_override_test',
  ));
  \Drupal::state()
    ->set('config_events_test.event', FALSE);
  $this
    ->installConfig(array(
    'language_config_override_test',
  ));
  $event_recorder = \Drupal::state()
    ->get('config_events_test.event', FALSE);
  $this
    ->assertFalse($event_recorder);
  $config = \Drupal::service('language.config_factory_override')
    ->getOverride('de', 'language_config_override_test.settings');
  $this
    ->assertEqual($config
    ->get('name'), 'Deutsch');
}