From 915d745f2c6ac55cccd48c5a83a975d90b6267eb Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Mon, 13 Oct 2008 10:17:01 +0000 Subject: [PATCH] tiny simpletest fix: start and end output buffering a bit more sensibly. --- lib/simpletestlib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/simpletestlib.php b/lib/simpletestlib.php index f303838b69..814b7beb76 100644 --- a/lib/simpletestlib.php +++ b/lib/simpletestlib.php @@ -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(); + } } /** -- 2.39.5