From b9d49615712efef427108b1eef07e8d8bfe03696 Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Fri, 17 Jan 2020 14:48:55 +0100 Subject: [PATCH] Turn off web error handler for CLI (breaks a lot of stuff!) error_handler now only runs set_error_handler in web mode. E_ALL notices, warnings, and errors are now reported, which causes the test harness to fail. --- class2.php | 3 ++- e107_tests/tests/_support/Helper/Unit.php | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/class2.php b/class2.php index 7db0838aa..a71d8b784 100755 --- a/class2.php +++ b/class2.php @@ -144,7 +144,6 @@ if(!defined('e_ROOT')) // (Now we can see PHP errors) -- but note that DEBUG is not yet enabled! // $error_handler = new error_handler(); -set_error_handler(array(&$error_handler, 'handle_error')); // // E: Setup other essential PHP parameters @@ -2462,6 +2461,8 @@ class error_handler { error_reporting(E_ERROR | E_PARSE); } + + set_error_handler(array(&$this, 'handle_error')); } /** diff --git a/e107_tests/tests/_support/Helper/Unit.php b/e107_tests/tests/_support/Helper/Unit.php index 13da91507..b20d99908 100644 --- a/e107_tests/tests/_support/Helper/Unit.php +++ b/e107_tests/tests/_support/Helper/Unit.php @@ -15,8 +15,7 @@ class Unit extends E107Base global $_E107; $_E107 = array(); $_E107['cli'] = true; - $_E107['phpunit'] = true; - #$_E107['debug'] = true; + $_E107['debug'] = true; codecept_debug("Loading ".APP_PATH."/class2.php…"); define('E107_DBG_BASIC', true);