mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-20 14:17:46 +01:00
merge from yiisoft/yii2
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user