You are here

function LanguagePathMonolingualTest::testPageLinks in Zircon Profile 8.0

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

Verifies that links do not have language prefixes in them.

File

core/modules/language/src/Tests/LanguagePathMonolingualTest.php, line 65
Contains \Drupal\language\Tests\LanguagePathMonolingualTest.

Class

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

Namespace

Drupal\language\Tests

Code

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
    ->assertResponse(200, 'Clicked link results in a valid page');
  $this
    ->assertText(t('Add language'), 'Page contains the add language text');
}