You are here

protected function RedirectTestHelper::assertRedirect in Redirect 7

Same name and namespace in other branches
  1. 7.2 redirect.test \RedirectTestHelper::assertRedirect()
2 calls to RedirectTestHelper::assertRedirect()
RedirectFunctionalTest::testDisableEnableRedirect in ./redirect.test
RedirectFunctionalTest::testPageCache in ./redirect.test

File

./redirect.test, line 14
Unit tests for the redirect module.

Class

RedirectTestHelper
@file Unit tests for the redirect module.

Code

protected function assertRedirect($redirect) {
  $source_url = url($redirect->source, array(
    'absolute' => TRUE,
  ) + $redirect->source_options);
  $redirect_url = url($redirect->redirect, array(
    'absolute' => TRUE,
  ) + $redirect->redirect_options);
  $this
    ->drupalGet($source_url);
  $this
    ->assertEqual($this
    ->getUrl(), $redirect_url, t('Page %source was redirected to %redirect.', array(
    '%source' => $source_url,
    '%redirect' => $redirect_url,
  )));

  // Reload the redirect.
  if (!empty($redirect->rid)) {
    return redirect_load($redirect->rid);
  }
}