Fix ControllerTestCase redirect

This commit is contained in:
Mark Scherer 2015-01-26 10:31:04 +01:00
parent 76f7754014
commit e753fbadca

View file

@ -751,7 +751,7 @@ class Controller extends Object implements CakeEventListener {
*
* @param string|array $url A string or array-based URL pointing to another location within the app,
* or an absolute URL
* @param int $status Optional HTTP status code (eg: 404)
* @param int $status HTTP status code (eg: 301)
* @param bool $exit If true, exit() will be called after the redirect
* @return void
* @triggers Controller.beforeRedirect $this, array($url, $status, $exit)
@ -785,6 +785,9 @@ class Controller extends Object implements CakeEventListener {
}
}
if ($status === null) {
$status = 302;
}
if ($status) {
$this->response->statusCode($status);
}