function 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 174
Class
- LanguageNegotiationInfoTest
- Tests alterations to language types/negotiation info.
Namespace
Drupal\Tests\language\FunctionalCode
protected function checkFixedLanguageTypes() : void {
$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, "language negotiation for {$type} is properly set up");
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.