From 5908bc912409e3498088de46997aa2322c039a4e Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Wed, 7 Dec 2016 12:44:21 +1300 Subject: [PATCH 1/2] Make clearMessages() clear all (not just one) message per default. Also minor typo fix in exception message. CRM-19726 --- tests/phpunit/CiviTest/CiviMailUtils.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviMailUtils.php b/tests/phpunit/CiviTest/CiviMailUtils.php index 3c3dadf09da6..7d01ec11e945 100644 --- a/tests/phpunit/CiviTest/CiviMailUtils.php +++ b/tests/phpunit/CiviTest/CiviMailUtils.php @@ -331,12 +331,13 @@ public function assertSubjects($expectedSubjects) { * Remove any sent messages from the log. * * @param int $limit + * How many recent messages to remove, defaults to 0 (all). * * @throws \Exception */ - public function clearMessages($limit = 1) { + public function clearMessages($limit = 0) { if ($this->_webtest) { - throw new Exception("Not implementated: clearMessages for WebTest"); + throw new Exception("Not implemented: clearMessages for WebTest"); } else { CRM_Core_DAO::executeQuery('DELETE FROM civicrm_mailing_spool ORDER BY id DESC LIMIT ' . $limit); From e413a7ff90e5d8013adcd8e7c229d556c1e9cc05 Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Wed, 7 Dec 2016 12:58:15 +1300 Subject: [PATCH 2/2] Remove 999 and 99999 parameters from CiviMailUtils::clearMessages() calls. CRM-19726 --- tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php | 2 +- tests/phpunit/api/v3/ContributionPageTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php index cbb5ce2920e0..3b7ee710b7f6 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php @@ -165,7 +165,7 @@ public function testIPNPaymentMembershipRecurSuccessNoLeakageOnlineThenOffline() $this->_contributionPageID = NULL; $this->setupMembershipRecurringPaymentProcessorTransaction(array('is_email_receipt' => TRUE)); - $mut->clearMessages(99999); + $mut->clearMessages(); $IPN = new CRM_Core_Payment_AuthorizeNetIPN($this->getRecurTransaction(array('x_trans_id' => 'hers'))); $IPN->main(); diff --git a/tests/phpunit/api/v3/ContributionPageTest.php b/tests/phpunit/api/v3/ContributionPageTest.php index 4cde02fdcf0a..41fa59352d89 100644 --- a/tests/phpunit/api/v3/ContributionPageTest.php +++ b/tests/phpunit/api/v3/ContributionPageTest.php @@ -379,7 +379,7 @@ public function testSubmitMembershipBlockNotSeparatePaymentZeroDollarsWithEmail( ) ); $mut->stop(); - $mut->clearMessages(999); + $mut->clearMessages(); } /** @@ -453,7 +453,7 @@ public function testSubmitMembershipBlockIsSeparatePaymentWithEmail() { ) ); $mut->stop(); - $mut->clearMessages(999); + $mut->clearMessages(); } /**