function LocaleConfigSubscriberForeignTest::saveLanguageActive
Same name in other branches
- 9 core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberForeignTest.php \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberForeignTest::saveLanguageActive()
- 8.9.x core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberForeignTest.php \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberForeignTest::saveLanguageActive()
- 10 core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberForeignTest.php \Drupal\Tests\locale\Kernel\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/ tests/ src/ Kernel/ LocaleConfigSubscriberForeignTest.php - Tests creating translations of shipped configuration.
- LocaleConfigSubscriberForeignTest::testUpdateActiveTranslation in core/
modules/ locale/ tests/ src/ Kernel/ LocaleConfigSubscriberForeignTest.php - Tests updating translations of shipped configuration.
File
-
core/
modules/ locale/ tests/ src/ Kernel/ LocaleConfigSubscriberForeignTest.php, line 161
Class
- LocaleConfigSubscriberForeignTest
- Tests default configuration handling with a foreign default language.
Namespace
Drupal\Tests\locale\KernelCode
protected function saveLanguageActive($config_name, $key, $value, $langcode) : void {
$this->configFactory
->getEditable($config_name)
->set($key, $value)
->save();
$this->assertActiveConfig($config_name, $key, $value, $langcode);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.