1 locale.test | public LocaleUrlRewritingTest::testUrlRewritingTwice() |
Check that rewriting a URL that is already rewritten produces the same URL
File
- core/
modules/ locale/ tests/ locale.test, line 2517 - Tests for locale.module.
Class
- LocaleUrlRewritingTest
- Test that URL rewriting works as expected.
Code
public function testUrlRewritingTwice() {
// Create a URL with a language prefix.
$languages = language_list();
$language = $languages['fr'];
$url = url('node', array('language' => $language));
// Check that the URL is rewritten correctly.
$this->assertEqual($url, '/fr/node', 'The URL is rewritten correctly.');
// Check that the URL is not rewritten again.
$url = url($url, array('language' => $language));
$this->assertEqual($url, '/fr/node', 'The URL is not rewritten again.');
}