You are here

function LanguageUrlRewritingTest::testUrlRewritingEdgeCases in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/src/Tests/LanguageUrlRewritingTest.php \Drupal\language\Tests\LanguageUrlRewritingTest::testUrlRewritingEdgeCases()

Check that non-installed languages are not considered.

File

core/modules/language/src/Tests/LanguageUrlRewritingTest.php, line 62
Contains \Drupal\language\Tests\LanguageUrlRewritingTest.

Class

LanguageUrlRewritingTest
Tests that URL rewriting works as expected.

Namespace

Drupal\language\Tests

Code

function testUrlRewritingEdgeCases() {

  // Check URL rewriting with a non-installed language.
  $non_existing = new Language(array(
    'id' => $this
      ->randomMachineName(),
  ));
  $this
    ->checkUrl($non_existing, 'Path language is ignored if language is not installed.', 'URL language negotiation does not work with non-installed languages');

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