1 redirect.test | protected RedirectTestHelper::assertRedirect($redirect) |
File
- core/
modules/ redirect/ tests/ redirect.test, line 20 - Unit tests for the redirect module.
Class
Code
protected function assertRedirect($redirect) {
backdrop_static_reset('backdrop_lookup_path');
$source_url = url($redirect->source, array('absolute' => TRUE) + $redirect->source_options);
$redirect_url = url($redirect->redirect, array('absolute' => TRUE) + $redirect->redirect_options);
$this->backdropGet($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, TRUE);
}
return FALSE;
}