From: eileenmcnaugton Date: Thu, 26 Nov 2015 07:05:36 +0000 (+1300) Subject: Test fix - allow clear messages to clear multiple messages X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1ccd7c3056718a06cc5463e34e6b46cef547d5d2;p=civicrm-core.git Test fix - allow clear messages to clear multiple messages --- 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); } }