mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
skip exiting in test env.
see 0cfd41a21a (commitcomment-5238567)
issue #2233
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user