]> git.mjollnir.org Git - moodle.git/commitdiff
tiny simpletest fix: start and end output buffering a bit more sensibly.
authormjollnir_ <mjollnir_>
Mon, 13 Oct 2008 10:17:01 +0000 (10:17 +0000)
committermjollnir_ <mjollnir_>
Mon, 13 Oct 2008 10:17:01 +0000 (10:17 +0000)
lib/simpletestlib.php

index f303838b69be4c9f925f013ddd64677d61c1cc4d..814b7beb765a805bb5d0d7082a7bfa36ed52d7b9 100644 (file)
@@ -247,6 +247,7 @@ class MoodleUnitTestCase extends UnitTestCase {
         UnitTestDB::instantiate();
         global $DB;
         $this->DB =& $DB;
+        ob_start();
     }
 
     /**
@@ -261,8 +262,9 @@ class MoodleUnitTestCase extends UnitTestCase {
         parent::tearDown();
 
         // Output buffering
-        ob_end_flush();
-        ob_start();
+        if (ob_get_length() > 0) {
+            ob_end_flush();
+        }
     }
 
     /**