function LanguageSwitchingTest::testLanguageLinkActiveClass

Test active class on links when switching languages.

File

core/modules/language/tests/src/Functional/LanguageSwitchingTest.php, line 245

Class

LanguageSwitchingTest
Functional tests for the language switching feature.

Namespace

Drupal\Tests\language\Functional

Code

public function testLanguageLinkActiveClass() {
  // Add language.
  $edit = [
    'predefined_langcode' => 'fr',
  ];
  $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
  // Enable URL language detection and selection.
  $edit = [
    'language_interface[enabled][language-url]' => '1',
  ];
  $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
  $this->doTestLanguageLinkActiveClassAuthenticated();
  $this->doTestLanguageLinkActiveClassAnonymous();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.