You are here

public function LocaleLocaleLookupTest::testLanguageFallbackDefaults in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/Tests/LocaleLocaleLookupTest.php \Drupal\locale\Tests\LocaleLocaleLookupTest::testLanguageFallbackDefaults()

Test language fallback defaults.

File

core/modules/locale/src/Tests/LocaleLocaleLookupTest.php, line 52
Contains \Drupal\locale\Tests\LocaleLocaleLookupTest.

Class

LocaleLocaleLookupTest
Tests LocaleLookup.

Namespace

Drupal\locale\Tests

Code

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'), array());

  // 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');
}