in case of phpunit executions calling header() and exit() is too bad

This commit is contained in:
Thomas Müller 2014-03-14 18:20:33 +01:00
parent fe05c0c81b
commit bbbbb033f3

View file

@ -367,9 +367,14 @@ class Helper {
$post = 0;
if(count($_POST) > 0) {
$post = 1;
}
header('Location: ' . $location . '?p=' . $post . '&errorCode=' . $errorCode);
exit();
}
if(defined('PHPUNIT_RUN') and PHPUNIT_RUN) {
throw new \Exception("Encryption error: $errorCode");
}
header('Location: ' . $location . '?p=' . $post . '&errorCode=' . $errorCode);
exit();
}
/**