You are here

function LocaleUrlRewritingTest::testUrlRewritingEdgeCases in Drupal 7

Check that disabled or non-installed languages are not considered.

File

modules/locale/locale.test, line 2632
Tests for locale.module.

Class

LocaleUrlRewritingTest
Test that URL rewriting works as expected.

Code

function testUrlRewritingEdgeCases() {

  // Check URL rewriting with a disabled language.
  $languages = language_list();
  $this
    ->checkUrl($languages['it'], 'Path language is ignored if language is disabled.', 'URL language negotiation does not work with disabled languages');

  // Check URL rewriting with a non-installed language.
  $non_existing = language_default();
  $non_existing->language = $this
    ->randomName();
  $non_existing->prefix = $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');
}