From e88f4fee7d3978f506cf98f7e9c70bda53dd57dc Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 21 Nov 2019 22:09:54 +1300 Subject: [PATCH] Minor test cleanup on CiviMailUtils --- tests/phpunit/CiviTest/CiviMailUtils.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviMailUtils.php b/tests/phpunit/CiviTest/CiviMailUtils.php index 11569972aa..8812752e40 100644 --- a/tests/phpunit/CiviTest/CiviMailUtils.php +++ b/tests/phpunit/CiviTest/CiviMailUtils.php @@ -168,20 +168,19 @@ class CiviMailUtils extends PHPUnit\Framework\TestCase { * @param string $type * 'raw'|'ezc'. * - * @throws Exception + * @throws CRM_Core_Exception + * * @return array(ezcMail)|array(string) */ public function getAllMessages($type = 'raw') { - $msgs = array(); + $msgs = []; if ($this->_webtest) { - throw new Exception("Not implemented: getAllMessages for WebTest"); + throw new CRM_Core_Exception('Not implemented: getAllMessages for WebTest'); } - else { - $dao = CRM_Core_DAO::executeQuery('SELECT headers, body FROM civicrm_mailing_spool ORDER BY id'); - while ($dao->fetch()) { - $msgs[] = $dao->headers . "\n\n" . $dao->body; - } + $dao = CRM_Core_DAO::executeQuery('SELECT headers, body FROM civicrm_mailing_spool ORDER BY id'); + while ($dao->fetch()) { + $msgs[] = $dao->headers . "\n\n" . $dao->body; } switch ($type) { -- 2.25.1