From fc4f36be117d8bef637d1726a4bee6c79f647e8f Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 22 Aug 2013 14:46:26 +1200 Subject: [PATCH] MDL-41196 phpmailer: fixed unit test detection --- lib/phpmailer/moodle_phpmailer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/phpmailer/moodle_phpmailer.php b/lib/phpmailer/moodle_phpmailer.php index d386ab6c67c..eda2afd7d51 100644 --- a/lib/phpmailer/moodle_phpmailer.php +++ b/lib/phpmailer/moodle_phpmailer.php @@ -128,7 +128,7 @@ class moodle_phpmailer extends PHPMailer { protected function PostSend() { // Now ask phpunit if it wants to catch this message. - if (phpunit_util::is_redirecting_messages()) { + if (PHPUNIT_TEST && phpunit_util::is_redirecting_messages()) { $mail = new stdClass(); $mail->header = $this->MIMEHeader; $mail->body = $this->MIMEBody;