public function LanguageUrlRewritingTest::testUrlRewritingEdgeCases in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php \Drupal\Tests\language\Functional\LanguageUrlRewritingTest::testUrlRewritingEdgeCases()
- 9 core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php \Drupal\Tests\language\Functional\LanguageUrlRewritingTest::testUrlRewritingEdgeCases()
Check that non-installed languages are not considered.
File
- core/
modules/ language/ tests/ src/ Functional/ LanguageUrlRewritingTest.php, line 67
Class
- LanguageUrlRewritingTest
- Tests that URL rewriting works as expected.
Namespace
Drupal\Tests\language\FunctionalCode
public function testUrlRewritingEdgeCases() {
// Check URL rewriting with a non-installed language.
$non_existing = new Language([
'id' => $this
->randomMachineName(),
]);
$this
->checkUrl($non_existing, 'Path language is ignored if language is not installed.');
// Check that URL rewriting is not applied to subrequests.
$this
->drupalGet('language_test/subrequest');
$this
->assertSession()
->pageTextContains($this->webUser
->getAccountName());
}