From 4ad85bd857a5233c2938d98d825bac9b0a66e275 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Sat, 26 May 2012 12:15:17 +0800 Subject: [PATCH] MDL-33359 - mtrace: dont output to STDOUT in unit tests This allows us to use phpunit output buffering functions --- lib/moodlelib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 8b0379b9551..23ee2f5630c 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -9642,7 +9642,7 @@ function address_in_subnet($addr, $subnetstr) { */ function mtrace($string, $eol="\n", $sleep=0) { - if (defined('STDOUT')) { + if (defined('STDOUT') and !PHPUNIT_TEST) { fwrite(STDOUT, $string.$eol); } else { echo $string . $eol;