From 1cec45f1c07733058a7eb16e5ca7e6534289e978 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Thu, 5 May 2011 12:10:27 +0100 Subject: [PATCH] MDL-26778 Completion unit tests broken by earlier change --- lib/completionlib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/completionlib.php b/lib/completionlib.php index c705d6194ed..7f79c950f08 100644 --- a/lib/completionlib.php +++ b/lib/completionlib.php @@ -603,8 +603,8 @@ class completion_info { * @return void */ public function set_module_viewed($cm, $userid=0) { - global $PAGE; - if ($PAGE->headerprinted) { + global $PAGE, $UNITTEST; + if ($PAGE->headerprinted && empty($UNITTEST->running)) { debugging('set_module_viewed must be called before header is printed', DEBUG_DEVELOPER); }