protected function LanguageNegotiationInfoTest::checkFixedLanguageTypes in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/language/src/Tests/LanguageNegotiationInfoTest.php \Drupal\language\Tests\LanguageNegotiationInfoTest::checkFixedLanguageTypes()
Check that language negotiation for fixed types matches the stored one.
1 call to LanguageNegotiationInfoTest::checkFixedLanguageTypes()
- LanguageNegotiationInfoTest::testInfoAlterations in core/
modules/ language/ src/ Tests/ LanguageNegotiationInfoTest.php - Tests alterations to language types/negotiation info.
File
- core/
modules/ language/ src/ Tests/ LanguageNegotiationInfoTest.php, line 163 - Contains \Drupal\language\Tests\LanguageNegotiationInfoTest.
Class
- LanguageNegotiationInfoTest
- Tests alterations to language types/negotiation info.
Namespace
Drupal\language\TestsCode
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 = count($info['fixed']) == count($negotiation);
while ($equal && (list($id) = each($negotiation))) {
list(, $info_id) = each($info['fixed']);
$equal = $info_id == $id;
}
$this
->assertTrue($equal, format_string('language negotiation for %type is properly set up', array(
'%type' => $type,
)));
}
}
}