From aa1febb5d154c3809342bcc0c95130e620a42906 Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Thu, 26 Nov 2015 20:05:36 +1300 Subject: [PATCH] Test fix - allow clear messages to clear multiple messages --- tests/phpunit/CiviTest/CiviMailUtils.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviMailUtils.php b/tests/phpunit/CiviTest/CiviMailUtils.php index 0584d75650..5ad7f70bfb 100644 --- a/tests/phpunit/CiviTest/CiviMailUtils.php +++ b/tests/phpunit/CiviTest/CiviMailUtils.php @@ -338,13 +338,17 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { /** * Remove any sent messages from the log. + * + * @param int $limit + * + * @throws \Exception */ - public function clearMessages() { + public function clearMessages($limit = 1) { if ($this->_webtest) { throw new Exception("Not implementated: clearMessages for WebTest"); } else { - CRM_Core_DAO::executeQuery('DELETE FROM civicrm_mailing_spool ORDER BY id DESC LIMIT 1'); + CRM_Core_DAO::executeQuery('DELETE FROM civicrm_mailing_spool ORDER BY id DESC LIMIT '. $limit); } } -- 2.25.1