You are here

function PathRedirectUnitTest::testRedirects in Path redirect 6

1 call to PathRedirectUnitTest::testRedirects()
PathRedirectUnitTest::testNoCleanURLs in ./path_redirect.test

File

./path_redirect.test, line 95
Tests for the path_redirect module.

Class

PathRedirectUnitTest

Code

function testRedirects() {

  // Test a basic redirect (with and without a trailing slash requested).
  $this
    ->addRedirect('test', 'node');
  $this
    ->assertRedirect(array(
    'source' => 'test',
    'redirect' => 'node',
  ));
  $this
    ->assertRedirect(array(
    'source' => 'test/',
    'redirect' => 'node',
  ));

  // Test a unicode URL.
  $redirect = $this
    ->addRedirect('FrançAIS', 'http://example.com/');
  $this
    ->assertRedirect($redirect);

  // Test an URL with special characters.
  $redirect = $this
    ->addRedirect('foo_/ferzle-foo.bar', '<front>');
  $this
    ->assertRedirect($redirect);
}