public function LocaleLocaleLookupTest::testLanguageFallbackDefaults in Drupal 8
Same name and namespace in other branches
- 9 core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php \Drupal\Tests\locale\Functional\LocaleLocaleLookupTest::testLanguageFallbackDefaults()
- 10 core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php \Drupal\Tests\locale\Functional\LocaleLocaleLookupTest::testLanguageFallbackDefaults()
Test language fallback defaults.
File
- core/
modules/ locale/ tests/ src/ Functional/ LocaleLocaleLookupTest.php, line 53
Class
- LocaleLocaleLookupTest
- Tests LocaleLookup.
Namespace
Drupal\Tests\locale\FunctionalCode
public function testLanguageFallbackDefaults() {
$this
->drupalGet('');
// Ensure state of fallback languages persisted by
// locale_test_language_fallback_candidates_locale_lookup_alter() is empty.
$this
->assertEqual(\Drupal::state()
->get('locale.test_language_fallback_candidates_locale_lookup_alter_candidates'), []);
// Make sure there is enough information provided for alter hooks.
$context = \Drupal::state()
->get('locale.test_language_fallback_candidates_locale_lookup_alter_context');
$this
->assertEqual($context['langcode'], 'fr');
$this
->assertEqual($context['operation'], 'locale_lookup');
}