merge from yiisoft/yii2

This commit is contained in:
cuileon
2018-11-14 11:57:32 +08:00
parent 47df8a8cc0
commit 489dd119a5
426 changed files with 18465 additions and 4215 deletions

View File

@@ -21,6 +21,7 @@ class ErrorHandlerTest extends TestCase
'errorHandler' => [
'class' => 'yiiunit\framework\web\ErrorHandler',
'errorView' => '@yiiunit/data/views/errorHandler.php',
'exceptionView' => '@yiiunit/data/views/errorHandlerForAssetFiles.php',
],
],
]);
@@ -39,6 +40,19 @@ Message: This message is displayed to end user
Exception: yii\web\NotFoundHttpException', $out);
}
public function testClearAssetFilesInErrorView()
{
Yii::$app->getView()->registerJsFile('somefile.js');
/** @var ErrorHandler $handler */
$handler = Yii::$app->getErrorHandler();
ob_start(); // suppress response output
$this->invokeMethod($handler, 'renderException', [new \Exception('Some Exception')]);
ob_get_clean();
$out = Yii::$app->response->data;
$this->assertEquals('Exception View
', $out);
}
public function testRenderCallStackItem()
{
$handler = Yii::$app->getErrorHandler();