Commit 214f66a8 by Carsten Brandt
parent 7e807206
...@@ -515,7 +515,7 @@ abstract class Application extends Module ...@@ -515,7 +515,7 @@ abstract class Application extends Module
$handler->handle($exception); $handler->handle($exception);
} else { } else {
echo $this->renderException($exception); echo $this->renderException($exception);
if (PHP_SAPI === 'cli') { if (PHP_SAPI === 'cli' && !YII_ENV_TEST) {
exit(1); exit(1);
} }
} }
......
...@@ -87,8 +87,11 @@ class ErrorHandler extends Component ...@@ -87,8 +87,11 @@ class ErrorHandler extends Component
{ {
if (Yii::$app instanceof \yii\console\Application || YII_ENV_TEST) { if (Yii::$app instanceof \yii\console\Application || YII_ENV_TEST) {
echo Yii::$app->renderException($exception); echo Yii::$app->renderException($exception);
if (!YII_ENV_TEST) {
exit(1); exit(1);
} }
return;
}
$useErrorView = !YII_DEBUG || $exception instanceof UserException; $useErrorView = !YII_DEBUG || $exception instanceof UserException;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment