You are here

protected function GlobalRedirectTestCaseConfigLanguages::_globalredirect_test_paths in Global Redirect 7

Overrides GlobalRedirectTestCase::_globalredirect_test_paths

File

./globalredirect.test, line 420
Global Redirect functionality tests

Class

GlobalRedirectTestCaseConfigLanguages

Code

protected function _globalredirect_test_paths() {
  $settings = _globalredirect_get_settings();
  $paths = parent::_globalredirect_test_paths();

  // "node/1" has been defined as having an alias ("test-node") and Language NONE. Should 301 redirect to the alias. --- Test for source path request on aliased path
  $paths[] = array(
    'request' => 'fr/node/1',
    'return-code' => 301,
    'expected-path' => 'fr/test-node',
  );

  // "node/2" is english - should plainly redirect to an alias
  $paths[] = array(
    'request' => 'node/2',
    'return-code' => 301,
    'expected-path' => 'test-english-node',
  );

  // Node 3 is french. As no language prefix is provided, should redirect to the english version
  $paths[] = array(
    'request' => 'node/3',
    'return-code' => 301,
    'expected-path' => 'test-english-node',
  );

  // Now we're requesting a french node using the french language - redirect to the nodes alias with french prefix
  $paths[] = array(
    'request' => 'fr/node/3',
    'return-code' => 301,
    'expected-path' => 'fr/test-french-node',
  );

  // Node 4 is german - requesting under french prefix. Redirect to french node
  $paths[] = array(
    'request' => 'fr/node/4',
    'return-code' => 301,
    'expected-path' => 'fr/test-french-node',
  );

  // Node 3 is french, requesting with german prefix. Should redirect to the german node with german prefix.
  $paths[] = array(
    'request' => 'de/node/3',
    'return-code' => 301,
    'expected-path' => 'de/test-german-node',
  );
  return $paths;
}