From 1e0f58c7ae04e79c496923efd0bc3278a672bbe4 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 15 Jun 2019 21:32:07 -0400 Subject: [PATCH] Standardise exception use in test suite Using less different types of exceptions is cleaner- our own exception is pretty much our go-to so using here --- tests/phpunit/CiviTest/CiviMailUtils.php | 4 ++-- tests/phpunit/api/v3/PaymentTest.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviMailUtils.php b/tests/phpunit/CiviTest/CiviMailUtils.php index 79d7cbe09c..4697ea529a 100644 --- a/tests/phpunit/CiviTest/CiviMailUtils.php +++ b/tests/phpunit/CiviTest/CiviMailUtils.php @@ -331,11 +331,11 @@ class CiviMailUtils extends PHPUnit\Framework\TestCase { * @param int $limit * How many recent messages to remove, defaults to 0 (all). * - * @throws \Exception + * @throws \CRM_Core_Exception */ public function clearMessages($limit = 0) { if ($this->_webtest) { - throw new Exception("Not implemented: clearMessages for WebTest"); + throw new \CRM_Core_Exception("Not implemented: clearMessages for WebTest"); } else { $sql = 'DELETE FROM civicrm_mailing_spool ORDER BY id DESC'; diff --git a/tests/phpunit/api/v3/PaymentTest.php b/tests/phpunit/api/v3/PaymentTest.php index a0b0c5154a..6395c462a9 100644 --- a/tests/phpunit/api/v3/PaymentTest.php +++ b/tests/phpunit/api/v3/PaymentTest.php @@ -153,6 +153,8 @@ class api_v3_PaymentTest extends CiviUnitTestCase { /** * Test email receipt for partial payment. + * + * @throws \CRM_Core_Exception */ public function testPaymentEmailReceiptFullyPaid() { $mut = new CiviMailUtils($this); -- 2.25.1