function LanguageNegotiationInfoTest::checkFixedLanguageTypes
Same name in other branches
- 8.9.x core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php \Drupal\Tests\language\Functional\LanguageNegotiationInfoTest::checkFixedLanguageTypes()
- 10 core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php \Drupal\Tests\language\Functional\LanguageNegotiationInfoTest::checkFixedLanguageTypes()
- 11.x core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php \Drupal\Tests\language\Functional\LanguageNegotiationInfoTest::checkFixedLanguageTypes()
Check that language negotiation for fixed types matches the stored one.
1 call to LanguageNegotiationInfoTest::checkFixedLanguageTypes()
- LanguageNegotiationInfoTest::testInfoAlterations in core/
modules/ language/ tests/ src/ Functional/ LanguageNegotiationInfoTest.php - Tests alterations to language types/negotiation info.
File
-
core/
modules/ language/ tests/ src/ Functional/ LanguageNegotiationInfoTest.php, line 172
Class
- LanguageNegotiationInfoTest
- Tests alterations to language types/negotiation info.
Namespace
Drupal\Tests\language\FunctionalCode
protected function checkFixedLanguageTypes() {
$configurable = $this->languageManager()
->getLanguageTypes();
foreach ($this->languageManager()
->getDefinedLanguageTypesInfo() as $type => $info) {
if (!in_array($type, $configurable) && isset($info['fixed'])) {
$negotiation = $this->config('language.types')
->get('negotiation.' . $type . '.enabled');
$equal = array_keys($negotiation) === array_values($info['fixed']);
$this->assertTrue($equal, new FormattableMarkup('language negotiation for %type is properly set up', [
'%type' => $type,
]));
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.