Add in Country and StateProvince APIv4 Entities
[civicrm-core.git] / tests / phpunit / api / v3 / ContributionPageTest.php
index 0aca68c71eb8a948e330eb9ce822188d2f5b27b8..806a962543bd73dff0e56f7462fcf5505b10ef84 100644 (file)
@@ -1,27 +1,11 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 5                                                  |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
+ | Copyright CiviCRM LLC. All rights reserved.                        |
  |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
  */
 
@@ -56,14 +40,18 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    */
   protected $_ids = [];
 
-
   public $DBResetRequired = TRUE;
 
+  /**
+   * Setup for test.
+   *
+   * @throws \CRM_Core_Exception
+   */
   public function setUp() {
     parent::setUp();
     $this->contactIds[] = $this->individualCreate();
     $this->params = [
-      'title' => "Test Contribution Page",
+      'title' => 'Test Contribution Page',
       'financial_type_id' => 1,
       'currency' => 'NZD',
       'goal_amount' => $this->testAmount,
@@ -83,6 +71,12 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     ];
   }
 
+  /**
+   * Tear down after test.
+   *
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
+   */
   public function tearDown() {
     foreach ($this->contactIds as $id) {
       $this->callAPISuccess('contact', 'delete', ['id' => $id]);
@@ -92,8 +86,12 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
   }
 
   /**
+   * Test creating a contribution page.
+   *
    * @param int $version
+   *
    * @dataProvider versionThreeAndFour
+   * @throws \CRM_Core_Exception
    */
   public function testCreateContributionPage($version) {
     $this->_apiversion = $version;
@@ -104,8 +102,12 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
   }
 
   /**
+   * Test getting a contribution page.
+   *
    * @param int $version
+   *
    * @dataProvider versionThreeAndFour
+   * @throws \CRM_Core_Exception
    */
   public function testGetBasicContributionPage($version) {
     $this->_apiversion = $version;
@@ -119,6 +121,11 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     $this->assertEquals(1, $getResult['count']);
   }
 
+  /**
+   * Test get with amount as a parameter.
+   *
+   * @throws \CRM_Core_Exception
+   */
   public function testGetContributionPageByAmount() {
     $createResult = $this->callAPISuccess($this->_entity, 'create', $this->params);
     $this->id = $createResult['id'];
@@ -133,8 +140,12 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
   }
 
   /**
+   * Test page deletion.
+   *
    * @param int $version
+   *
    * @dataProvider versionThreeAndFour
+   * @throws \CRM_Core_Exception
    */
   public function testDeleteContributionPage($version) {
     $this->_apiversion = $version;
@@ -145,6 +156,11 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     $this->assertEquals(0, $checkDeleted['count']);
   }
 
+  /**
+   * Test getfields function.
+   *
+   * @throws \CRM_Core_Exception
+   */
   public function testGetFieldsContributionPage() {
     $result = $this->callAPISuccess($this->_entity, 'getfields', ['action' => 'create']);
     $this->assertEquals(12, $result['values']['start_date']['type']);
@@ -152,6 +168,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test form submission with basic price set.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmit() {
     $this->setUpContributionPage();
@@ -187,6 +205,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
   /**
    * Test form submission with billing first & last name where the contact does NOT
    * otherwise have one.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitNewBillingNameData() {
     $this->setUpContributionPage();
@@ -273,6 +293,9 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * Test process with instant payment when more than one configured for the page.
    *
    * CRM-16923
+   *
+   * @throws \CiviCRM_API3_Exception
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitRecurMultiProcessorInstantPayment() {
     $this->setUpContributionPage();
@@ -325,6 +348,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a membership block in place.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipBlockNotSeparatePayment() {
     $this->setUpMembershipContributionPage();
@@ -335,11 +360,10 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'billing_first_name' => 'Billy',
       'billing_middle_name' => 'Goat',
       'billing_last_name' => 'Gruff',
-      'selectMembership' => $this->_ids['membership_type'],
-
+      'selectMembership' => $this->_ids['membership_type'][0],
     ];
 
-    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
+    $this->callAPIAndDocument('ContributionPage', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
     $contribution = $this->callAPISuccess('contribution', 'getsingle', ['contribution_page_id' => $this->_ids['contribution_page']]);
     $membershipPayment = $this->callAPISuccess('membership_payment', 'getsingle', ['contribution_id' => $contribution['id']]);
     $this->callAPISuccessGetSingle('LineItem', ['contribution_id' => $contribution['id'], 'entity_id' => $membershipPayment['id']]);
@@ -357,11 +381,10 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     $submitParams = [
       'price_' . $this->_ids['price_field'][0] => reset($this->_ids['price_field_value']),
       'id' => (int) $this->_ids['contribution_page'],
-      'amount' => 10,
       'billing_first_name' => 'Billy',
       'billing_middle_name' => 'Goat',
       'billing_last_name' => 'Gruff',
-      'selectMembership' => $this->_ids['membership_type'],
+      'selectMembership' => $this->_ids['membership_type'][0],
       'payment_processor_id' => 1,
       'credit_card_number' => '4111111111111111',
       'credit_card_type' => 'Visa',
@@ -395,6 +418,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a membership block in place.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipBlockNotSeparatePaymentWithEmail() {
     $mut = new CiviMailUtils($this, TRUE);
@@ -404,11 +429,10 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     $submitParams = [
       'price_' . $this->_ids['price_field'][0] => reset($this->_ids['price_field_value']),
       'id' => (int) $this->_ids['contribution_page'],
-      'amount' => 10,
       'billing_first_name' => 'Billy',
       'billing_middle_name' => 'Goat',
       'billing_last_name' => 'Gruff',
-      'selectMembership' => $this->_ids['membership_type'],
+      'selectMembership' => $this->_ids['membership_type'][0],
       'email-Primary' => 'billy-goat@the-bridge.net',
       'payment_processor_id' => $this->_paymentProcessor['id'],
       'credit_card_number' => '4111111111111111',
@@ -430,6 +454,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a membership block in place.
+   *
+   * @throws \Exception
    */
   public function testSubmitMembershipBlockNotSeparatePaymentZeroDollarsWithEmail() {
     $mut = new CiviMailUtils($this, TRUE);
@@ -444,7 +470,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'billing_first_name' => 'Billy',
       'billing_middle_name' => 'Goat',
       'billing_last_name' => 'Gruffier',
-      'selectMembership' => $this->_ids['membership_type'],
+      'selectMembership' => $this->_ids['membership_type'][0],
       'email-Primary' => 'billy-goat@the-new-bridge.net',
       'payment_processor_id' => $this->params['payment_processor_id'],
     ];
@@ -468,6 +494,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a pay later abnd check line item in mails.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipBlockIsSeparatePaymentPayLaterWithEmail() {
     $mut = new CiviMailUtils($this, TRUE);
@@ -480,7 +508,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'billing_middle_name' => 'Goat',
       'billing_last_name' => 'Gruff',
       'is_pay_later' => 1,
-      'selectMembership' => $this->_ids['membership_type'],
+      'selectMembership' => $this->_ids['membership_type'][0],
       'email-Primary' => 'billy-goat@the-bridge.net',
     ];
 
@@ -496,6 +524,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a membership block in place.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipBlockIsSeparatePayment() {
     $this->setUpMembershipContributionPage(TRUE);
@@ -503,14 +533,14 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     $submitParams = [
       'price_' . $this->_ids['price_field'][0] => reset($this->_ids['price_field_value']),
       'id' => (int) $this->_ids['contribution_page'],
-      'amount' => 10,
       'billing_first_name' => 'Billy',
       'billing_middle_name' => 'Goat',
       'billing_last_name' => 'Gruff',
-      'selectMembership' => $this->_ids['membership_type'],
+      'selectMembership' => $this->_ids['membership_type'][0],
+      'amount' => 10,
     ];
 
-    $this->callAPISuccess('contribution_page', 'submit', $submitParams);
+    $this->callAPISuccess('ContributionPage', 'submit', $submitParams);
     $contributions = $this->callAPISuccess('contribution', 'get', ['contribution_page_id' => $this->_ids['contribution_page']]);
     $this->assertCount(2, $contributions['values']);
     $lines = $this->callAPISuccess('LineItem', 'get', ['sequential' => 1]);
@@ -523,6 +553,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a membership block in place.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipBlockIsSeparatePaymentWithPayLater() {
     $this->setUpMembershipContributionPage(TRUE);
@@ -560,6 +592,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a membership block in place.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipBlockIsSeparatePaymentWithEmail() {
     $mut = new CiviMailUtils($this, TRUE);
@@ -607,6 +641,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a membership block in place.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipBlockIsSeparatePaymentZeroDollarsPayLaterWithEmail() {
     $mut = new CiviMailUtils($this, TRUE);
@@ -644,6 +680,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a membership block in place.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipBlockTwoTypesIsSeparatePayment() {
     $this->_ids['membership_type'] = [$this->membershipTypeCreate(['minimum_fee' => 6])];
@@ -675,6 +713,9 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * Test submit with a membership block in place.
    *
    * We are expecting a separate payment for the membership vs the contribution.
+   *
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
   public function testSubmitMembershipBlockIsSeparatePaymentPaymentProcessorNow() {
     $mut = new CiviMailUtils($this, TRUE);
@@ -733,6 +774,9 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * @param string $thousandSeparator
    *   punctuation used to refer to thousands.
    *
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
+   *
    * @dataProvider getThousandSeparators
    */
   public function testSubmitMembershipBlockIsSeparatePaymentPaymentProcessorNowChargesCorrectAmounts($thousandSeparator) {
@@ -762,8 +806,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     // set custom hook
     $this->hookClass->setHook('civicrm_alterPaymentProcessorParams', [$this, 'hook_civicrm_alterPaymentProcessorParams']);
 
-    $this->callAPISuccess('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
-    $contributions = $this->callAPISuccess('contribution', 'get', [
+    $this->callAPISuccess('ContributionPage', 'submit', $submitParams);
+    $this->callAPISuccess('contribution', 'get', [
       'contribution_page_id' => $this->_ids['contribution_page'],
       'contribution_status_id' => 1,
     ]);
@@ -806,6 +850,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * Test that when a transaction fails the pending contribution remains.
    *
    * An activity should also be created. CRM-16417.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitPaymentProcessorFailure() {
     $this->setUpContributionPage();
@@ -844,6 +890,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * processor (IATS style - denoted by returning trxn_id)
    * - the first creates a new membership, completed contribution, in progress recurring. Check these
    * - create another - end date should be extended
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipPriceSetPaymentPaymentProcessorRecurInstantPaymentYear() {
     $this->doSubmitMembershipPriceSetPaymentPaymentProcessorRecurInstantPayment(['duration_unit' => 'year', 'recur_frequency_unit' => 'year']);
@@ -878,7 +926,6 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * @param array $params
    *
    * @throws \CRM_Core_Exception
-   * @throws \Exception
    */
   public function doSubmitMembershipPriceSetPaymentPaymentProcessorRecurInstantPayment($params = []) {
     $this->params['is_recur'] = 1;
@@ -967,6 +1014,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * processor (IATS style - denoted by returning trxn_id)
    * - the first creates a new membership, completed contribution, in progress recurring. Check these
    * - create another - end date should be extended
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipComplexNonPriceSetPaymentPaymentProcessorRecurInstantPayment() {
     $this->params['is_recur'] = 1;
@@ -1051,6 +1100,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * processor (IATS style - denoted by returning trxn_id)
    * - the first creates a new membership, completed contribution, in progress recurring. Check these
    * - create another - end date should be extended
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipComplexPriceSetPaymentPaymentProcessorRecurInstantPayment() {
     $this->params['is_recur'] = 1;
@@ -1132,6 +1183,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Extend the price set with a second organisation's membership.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function addSecondOrganizationMembershipToPriceSet() {
     $organization2ID = $this->organizationCreate();
@@ -1185,6 +1238,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * processor (IATS style - denoted by returning trxn_id)
    * - the first creates a new membership, completed contribution, in progress recurring. Check these
    * - create another - end date should be extended
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipPriceSetPaymentPaymentProcessorSeparatePaymentRecurInstantPayment() {
 
@@ -1200,7 +1255,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'billing_middle_name' => 'Goat',
       'billing_last_name' => 'Gruff',
       'email' => 'billy@goat.gruff',
-      'selectMembership' => $this->_ids['membership_type'],
+      'selectMembership' => $this->_ids['membership_type'][0],
       'payment_processor_id' => 1,
       'credit_card_number' => '4111111111111111',
       'credit_card_type' => 'Visa',
@@ -1212,7 +1267,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'frequency_unit' => 'month',
     ];
 
-    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
+    $this->callAPIAndDocument('ContributionPage', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
     $contribution = $this->callAPISuccess('contribution', 'get', [
       'contribution_page_id' => $this->_ids['contribution_page'],
       'contribution_status_id' => 1,
@@ -1232,6 +1287,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * - the first creates a pending membership, pending contribution, penging recurring. Check these
    * - complete the transaction
    * - create another - end date should NOT be extended
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipPriceSetPaymentPaymentProcessorRecurDelayed() {
     $this->params['is_recur'] = 1;
@@ -1255,7 +1312,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'billing_middle_name' => 'Goat',
       'billing_last_name' => 'Gruff',
       'email' => 'billy@goat.gruff',
-      'selectMembership' => $this->_ids['membership_type'],
+      'selectMembership' => $this->_ids['membership_type'][0],
       'payment_processor_id' => 1,
       'credit_card_number' => '4111111111111111',
       'credit_card_type' => 'Visa',
@@ -1322,6 +1379,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test non-recur contribution with membership payment
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMembershipIsSeparatePaymentNotRecur() {
     //Create recur contribution page.
@@ -1340,7 +1399,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'billing_middle_name' => 'Goat',
       'billing_last_name' => 'Gruff',
       'email' => 'billy@goat.gruff',
-      'selectMembership' => $this->_ids['membership_type'],
+      'selectMembership' => $this->_ids['membership_type'][0],
       'payment_processor_id' => 1,
       'credit_card_number' => '4111111111111111',
       'credit_card_type' => 'Visa',
@@ -1356,9 +1415,12 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Set up membership contribution page.
+   *
    * @param bool $isSeparatePayment
    * @param bool $isRecur
    * @param array $membershipTypeParams Parameters to pass to membershiptype.create API
+   *
+   * @throws \CRM_Core_Exception
    */
   public function setUpMembershipContributionPage($isSeparatePayment = FALSE, $isRecur = FALSE, $membershipTypeParams = []) {
     $this->setUpMembershipBlockPriceSet($membershipTypeParams);
@@ -1394,6 +1456,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * The default data set does not include a complete default membership price set - not quite sure why.
    *
    * This function ensures it exists & populates $this->_ids with it's data
+   *
+   * @throws \CRM_Core_Exception
    */
   public function setUpMembershipBlockPriceSet($membershipTypeParams = []) {
     $this->_ids['price_set'][] = $this->callAPISuccess('price_set', 'getvalue', [
@@ -1470,6 +1534,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Add text field other amount to the price set.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function addOtherAmountFieldToMembershipPriceSet() {
     $this->_ids['price_field']['other_amount'] = $this->callAPISuccess('price_field', 'create', [
@@ -1491,7 +1557,10 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Help function to set up contribution page with some defaults.
+   *
    * @param bool $isRecur
+   *
+   * @throws \CRM_Core_Exception
    */
   public function setUpContributionPage($isRecur = FALSE) {
     if ($isRecur) {
@@ -1549,6 +1618,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
   /**
    * Helper function to set up contribution page which can be used to purchase a
    * membership type for different intervals.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function setUpMultiIntervalMembershipContributionPage() {
     $this->setupPaymentProcessor();
@@ -1561,7 +1632,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'duration_unit' => 'month',
     ]);
 
-    $priceSet = civicrm_api3('PriceSet', 'create', [
+    $priceSet = $this->callAPISuccess('PriceSet', 'create', [
       'is_quick_config' => 0,
       'extends' => 'CiviMember',
       'financial_type_id' => 'Member Dues',
@@ -1613,6 +1684,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Test submit with a membership block in place.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitMultiIntervalMembershipContributionPage() {
     $this->setUpMultiIntervalMembershipContributionPage();
@@ -1648,22 +1721,10 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     // put stuff here that should happen before all tests in this unit
   }
 
-  /**
-   * @throws \Exception
-   */
-  public static function tearDownAfterClass() {
-    $tablesToTruncate = [
-      'civicrm_contact',
-      'civicrm_financial_type',
-      'civicrm_contribution',
-      'civicrm_contribution_page',
-    ];
-    $unitTest = new CiviUnitTestCase();
-    $unitTest->quickCleanup($tablesToTruncate);
-  }
-
   /**
    * Create a payment processor instance.
+   *
+   * @throws \CRM_Core_Exception
    */
   protected function setupPaymentProcessor() {
     $this->params['payment_processor_id'] = $this->_ids['payment_processor'] = $this->paymentProcessorCreate([
@@ -1678,6 +1739,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * Test submit recurring pledge.
    *
    * - we process 1 pledge with a future start date. A recur contribution and the pledge should be created with first payment date in the future.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitPledgePaymentPaymentProcessorRecurFuturePayment() {
     $this->params['adjust_recur_start_date'] = TRUE;
@@ -1746,6 +1809,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    * Test submit pledge payment.
    *
    * - test submitting a pledge payment using contribution form.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitPledgePayment() {
     $this->testSubmitPledgePaymentPaymentProcessorRecurFuturePayment();
@@ -1798,6 +1863,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    *   punctuation used to refer to thousands.
    *
    * @dataProvider getThousandSeparators
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitContributionPageWithPriceSet($thousandSeparator) {
     $this->setCurrencySeparators($thousandSeparator);
@@ -1833,7 +1899,10 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
   /**
    * Function to add additional price fields to priceset.
+   *
    * @param array $params
+   *
+   * @throws \CRM_Core_Exception
    */
   public function addPriceFields(&$params) {
     $priceSetID = reset($this->_ids['price_set']);
@@ -1869,6 +1938,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
    *   punctuation used to refer to thousands.
    *
    * @dataProvider getThousandSeparators
+   * @throws \CRM_Core_Exception
    */
   public function testSubmitContributionPageWithPriceSetQuantity($thousandSeparator) {
     $this->setCurrencySeparators($thousandSeparator);