]> git.mjollnir.org Git - moodle.git/commitdiff
unit tests: MDL-20398 spurious exceptions when $CFG->debugdisplay is false
authortjhunt <tjhunt>
Wed, 30 Sep 2009 18:13:27 +0000 (18:13 +0000)
committertjhunt <tjhunt>
Wed, 30 Sep 2009 18:13:27 +0000 (18:13 +0000)
Doh! I had the logic the wrong way round in my previous commit. Sorry.

lib/weblib.php

index 0c3bd743b5cf841ef32ffda8d6e8aa5f8fc7a8af..131f0f651615dc73a315fa1e707aea8c4e2d5231 100644 (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.