diff --git a/cake/console/cake.php b/cake/console/cake.php index 1ec1e9088..472987c46 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -257,7 +257,7 @@ class ShellDispatcher { $boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php'); require CORE_PATH . 'cake' . DS . 'bootstrap.php'; - require CORE_PATH . 'cake' . DS . 'console' . DS . 'console_error_handler.php'; + require_once CORE_PATH . 'cake' . DS . 'console' . DS . 'console_error_handler.php'; set_exception_handler(array('ConsoleErrorHandler', 'handleException')); if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) { diff --git a/cake/console/console_error_handler.php b/cake/console/console_error_handler.php index 58ce9527d..91469b89e 100644 --- a/cake/console/console_error_handler.php +++ b/cake/console/console_error_handler.php @@ -105,7 +105,7 @@ class ConsoleErrorHandler extends ErrorHandler { * @return void */ public function _outputMessage($template = null) { - $this->stderr($this->error->getMessage()); + $this->stderr($this->error->getMessage() . "\n" . $this->error->getTraceAsString()); } /** diff --git a/cake/tests/cases/console/console_error_handler.test.php b/cake/tests/cases/console/console_error_handler.test.php index a35083bc6..d6e3b261e 100644 --- a/cake/tests/cases/console/console_error_handler.test.php +++ b/cake/tests/cases/console/console_error_handler.test.php @@ -17,7 +17,7 @@ * @since CakePHP(tm) v 2.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -require CAKE . 'console' . DS . 'console_error_handler.php'; +require_once CAKE . 'console' . DS . 'console_error_handler.php'; /** * ConsoleErrorHandler Test case. @@ -45,7 +45,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase { $error = $this->getErrorHandler($exception); $error->expects($this->once())->method('stderr') - ->with('Missing action'); + ->with($this->stringContains('Missing action')); $error->render(); } @@ -60,7 +60,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase { $error = $this->getErrorHandler($exception); $error->expects($this->once())->method('stderr') - ->with('Too many parameters.'); + ->with($this->stringContains('Too many parameters.')); $error->render(); } @@ -75,7 +75,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase { $error = $this->getErrorHandler($exception); $error->expects($this->once())->method('stderr') - ->with('dont use me in cli.'); + ->with($this->stringContains('dont use me in cli.')); $error->render(); } @@ -90,7 +90,7 @@ class ConsoleErrorHandlerTest extends CakeTestCase { $error = $this->getErrorHandler($exception); $error->expects($this->once())->method('stderr') - ->with('dont use me in cli.'); + ->with($this->stringContains('dont use me in cli.')); $error->render(); }