'expected_method_id' => LanguageNegotiatorInterface::METHOD_ID,
'http_header' =>
$http_header_blah,
'message' => 'URL (PATH) > BROWSER > DEFAULT: no language prefix and browser language preference set to unknown language should use default language',
],
];
foreach ($tests as $test) { $this->
doRunTest($test);
} // Unknown language prefix should return 404.
$definitions = \Drupal::
languageManager()->
getNegotiator()->
getNegotiationMethods();
// Enable only methods, which are either not limited to a specific language
// type or are supporting the interface language type.
$language_interface_method_definitions =
array_filter($definitions,
function D
$method_definition) { return !
isset($method_definition['types'
]) || (isset($method_definition['types'
]) &&
in_array(LanguageInterface::TYPE_INTERFACE,
$method_definition['types'
]));
});
$this->
config('language.types'
) ->
set('negotiation.' . LanguageInterface::TYPE_INTERFACE . '.enabled',
array_flip(array_keys($language_interface_method_definitions))) ->
save();
$this->
drupalGet("
$langcode_unknown/admin/config",
[],
$http_header_browser_fallback);
$this->
assertSession()->
statusCodeEquals(404
);