unit tests: MDL-20398 spurious exceptions when $CFG->debugdisplay is false

Doh! I had the logic the wrong way round in my previous commit. Sorry.
This commit is contained in:
tjhunt 2009-09-30 18:13:27 +00:00
parent 4f19b365b8
commit 477082146b

View File

@ -3151,7 +3151,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) {
$backtrace = debug_backtrace();
}
$from = format_backtrace($backtrace, CLI_SCRIPT);
if ($CFG->debugdisplay || empty($UNITTEST->running)) {
if ($CFG->debugdisplay || isset($UNITTEST->running)) {
// When the unit tests are running, any call to trigger_error
// is intercepted by the test framework and reported as an exception.
// Therefore, we cannot use trigger_error during unit tests.