1
的的showAction方法時嘗試測試類調用ExceptionController
(位於vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php
類)的showAction
方法它標誌着作爲「風險」測試,說:的PHPUnit標誌着測試爲「有風險」,呼籲ExceptionController
測試代碼或測試代碼不(僅)關閉其自己的輸出緩衝器
示例代碼:
$request = Request::create('whatever', 'GET');
$request->attributes->set('showException', false);
$exception = FlattenException::create(new \Exception(), 404);
$controller = new ExceptionController($twig, true);
$response = $controller->showAction($request, $exception, null);
// some assertions....
爲了解決該問題,標題中的請求的
X-Php-Ob-Level
應設置爲
1