function LanguageUrlRewritingTest::testUrlRewritingEdgeCases

Check that non-installed languages are not considered.

File

drupal/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php, line 56
Definition of Drupal\language\Tests\LanguageUrlRewritingTest.

Class

LanguageUrlRewritingTest
Test that URL rewriting works as expected.

Namespace

Drupal\language\Tests

Code

function testUrlRewritingEdgeCases() {

  // Check URL rewriting with a non-installed language.
  $non_existing = language_default();
  $non_existing->langcode = $this
    ->randomName();
  $this
    ->checkUrl($non_existing, 'Path language is ignored if language is not installed.', 'URL language negotiation does not work with non-installed languages');
  $request = $this
    ->prepareRequestForGenerator();

  // Check that URL rewriting is not applied to subrequests.
  $this
    ->drupalGet('language_test/subrequest');
  $this
    ->assertText($this->web_user->name, 'Page correctly retrieved');
}