Standardise exception use in test suite
authoreileen <emcnaughton@wikimedia.org>
Sun, 16 Jun 2019 01:32:07 +0000 (21:32 -0400)
committereileen <emcnaughton@wikimedia.org>
Sun, 16 Jun 2019 12:55:59 +0000 (08:55 -0400)
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
tests/phpunit/api/v3/PaymentTest.php

index 79d7cbe09c7c9c692f8cc031d5b47a7b186fd35d..4697ea529ac7d15971f21311d34bfe65080d1cbd 100644 (file)
@@ -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';
index a0b0c5154acab8d5b6da1f493ba65b1394c18d52..6395c462a984d92c77e7718a7e6a7bca954cb4aa 100644 (file)
@@ -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);