function InstallerTranslationMultipleLanguageTest::verifyConfigLanguageAssumptions
Same name and namespace in other branches
- main core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationMultipleLanguageTest::verifyConfigLanguageAssumptions()
Verifies config entity and simple config langcode assumptions.
1 call to InstallerTranslationMultipleLanguageTest::verifyConfigLanguageAssumptions()
- InstallerTranslationMultipleLanguageTest::testTranslationsLoaded in core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerTranslationMultipleLanguageTest.php - Tests that translations ended up at the expected places.
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerTranslationMultipleLanguageTest.php, line 195
Class
- InstallerTranslationMultipleLanguageTest
- Tests translation files for multiple languages get imported during install.
Namespace
Drupal\FunctionalTests\InstallerCode
protected function verifyConfigLanguageAssumptions() : void {
if ($this->langcode === 'en') {
return;
}
$config_factory = \Drupal::configFactory();
foreach ([
'language.entity.de',
'language.entity.es',
] as $config_name) {
$this->assertEquals($this->langcode, $config_factory->get($config_name)
->get('langcode'), "Config entity '{$config_name}' should use the installation language langcode.");
}
$this->assertNull($config_factory->get('system.performance')
->get('langcode'), 'Non-entity config without translatable data should not be rewritten to the installation language.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.