From 26630991a6eb07a2a947e036c359f97519ec654e Mon Sep 17 00:00:00 2001 From: Humberto Pereira Date: Sat, 13 Jun 2015 12:45:27 -0400 Subject: [PATCH 1/2] CakeShells should not print html in case of a error --- lib/Cake/Console/ShellDispatcher.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index 30f37aa09..204237751 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -177,6 +177,9 @@ class ShellDispatcher { } set_exception_handler($exception['consoleHandler']); set_error_handler($error['consoleHandler'], Configure::read('Error.level')); + + App::uses('Debugger', 'Utility'); + Debugger::getInstance()->output('txt'); } /** From 77150eb6f6675f1dc7ca9a366135826c53cbeb91 Mon Sep 17 00:00:00 2001 From: Humberto Pereira Date: Sat, 13 Jun 2015 12:48:29 -0400 Subject: [PATCH 2/2] fixed tests cases to print html --- lib/Cake/Test/Case/Error/ErrorHandlerTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Cake/Test/Case/Error/ErrorHandlerTest.php b/lib/Cake/Test/Case/Error/ErrorHandlerTest.php index aa7448d64..18930737b 100644 --- a/lib/Cake/Test/Case/Error/ErrorHandlerTest.php +++ b/lib/Cake/Test/Case/Error/ErrorHandlerTest.php @@ -19,6 +19,7 @@ App::uses('ErrorHandler', 'Error'); App::uses('Controller', 'Controller'); App::uses('Router', 'Routing'); +App::uses('Debugger', 'Utility'); /** * A faulty ExceptionRenderer to test nesting. @@ -92,6 +93,8 @@ class ErrorHandlerTest extends CakeTestCase { set_error_handler('ErrorHandler::handleError'); $this->_restoreError = true; + Debugger::getInstance()->output('html'); + ob_start(); $wrong .= ''; $result = ob_get_clean(); @@ -123,6 +126,8 @@ class ErrorHandlerTest extends CakeTestCase { set_error_handler('ErrorHandler::handleError'); $this->_restoreError = true; + Debugger::getInstance()->output('html'); + ob_start(); trigger_error('Test error', $error);