skip exiting in test env.

see 0cfd41a21a (commitcomment-5238567)
issue #2233
This commit is contained in:
Carsten Brandt
2014-02-01 19:53:01 +01:00
parent 7e807206cc
commit 214f66a8c1
2 changed files with 5 additions and 2 deletions

View File

@ -515,7 +515,7 @@ abstract class Application extends Module
$handler->handle($exception);
} else {
echo $this->renderException($exception);
if (PHP_SAPI === 'cli') {
if (PHP_SAPI === 'cli' && !YII_ENV_TEST) {
exit(1);
}
}

View File

@ -87,8 +87,11 @@ class ErrorHandler extends Component
{
if (Yii::$app instanceof \yii\console\Application || YII_ENV_TEST) {
echo Yii::$app->renderException($exception);
if (!YII_ENV_TEST) {
exit(1);
}
return;
}
$useErrorView = !YII_DEBUG || $exception instanceof UserException;