You are here

protected function LocaleConfigSubscriberForeignTest::saveLanguageActive in Zircon Profile 8

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

Saves a language override.

This will invoke LocaleConfigSubscriber through the event dispatcher. To make sure the configuration was persisted correctly, the configuration value is checked. Because LocaleConfigSubscriber temporarily disables the override state of the configuration factory we check that the correct value is restored afterwards.

Parameters

string $config_name: The configuration name.

string $key: The configuration key.

string $value: The configuration value to save.

string $langcode: The language code.

2 calls to LocaleConfigSubscriberForeignTest::saveLanguageActive()
LocaleConfigSubscriberForeignTest::testCreateActiveTranslation in core/modules/locale/src/Tests/LocaleConfigSubscriberForeignTest.php
Tests creating translations of shipped configuration.
LocaleConfigSubscriberForeignTest::testUpdateActiveTranslation in core/modules/locale/src/Tests/LocaleConfigSubscriberForeignTest.php
Tests updating translations of shipped configuration.

File

core/modules/locale/src/Tests/LocaleConfigSubscriberForeignTest.php, line 161
Contains \Drupal\locale\Tests\LocaleConfigSubscriberForeignTest.

Class

LocaleConfigSubscriberForeignTest
Tests default configuration handling with a foreign default language.

Namespace

Drupal\locale\Tests

Code

protected function saveLanguageActive($config_name, $key, $value, $langcode) {
  $this->configFactory
    ->getEditable($config_name)
    ->set($key, $value)
    ->save();
  $this
    ->assertActiveConfig($config_name, $key, $value, $langcode);
}