From 1ccd7c3056718a06cc5463e34e6b46cef547d5d2 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 d70d0ee183..e3ba1266af 100644 --- a/tests/phpunit/CiviTest/CiviMailUtils.php +++ b/tests/phpunit/CiviTest/CiviMailUtils.php @@ -317,13 +317,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