public function LanguagePathMonolingualTest::testPageLinks in Drupal 9
Same name and namespace in other branches
- 8 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 73
Class
- LanguagePathMonolingualTest
- Confirm that paths are not changed on monolingual non-English sites.
Namespace
Drupal\Tests\language\FunctionalCode
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
->assertSession()
->linkByHrefNotExists('/fr/', 'Links do not contain language prefix');
// Verify that links in this page can be followed and work.
$this
->clickLink('Languages');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains('Add language');
}