You are here

public function LanguagePathMonolingualTest::testPageLinks in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php \Drupal\Tests\language\Functional\LanguagePathMonolingualTest::testPageLinks()

Verifies that links do not have language prefixes in them.

File

core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php, line 69

Class

LanguagePathMonolingualTest
Confirm that paths are not changed on monolingual non-English sites.

Namespace

Drupal\Tests\language\Functional

Code

public function testPageLinks() {

  // Navigate to 'admin/config' path.
  $this
    ->drupalGet('admin/config');

  // Verify that links in this page do not have a 'fr/' prefix.
  $this
    ->assertNoLinkByHref('/fr/', 'Links do not contain language prefix');

  // Verify that links in this page can be followed and work.
  $this
    ->clickLink(t('Languages'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertText(t('Add language'), 'Page contains the add language text');
}