From: Matthew Wire Date: Sat, 28 Apr 2018 20:32:53 +0000 (+0100) Subject: Add unit test coverage for financial_type_id X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=248a226ebea240b687080ed1097b94797aad570e;p=civicrm-core.git Add unit test coverage for financial_type_id --- diff --git a/tests/phpunit/CRM/Contribute/Form/Contribution/ConfirmTest.php b/tests/phpunit/CRM/Contribute/Form/Contribution/ConfirmTest.php index d7e09bb696..bb594d6e7b 100644 --- a/tests/phpunit/CRM/Contribute/Form/Contribution/ConfirmTest.php +++ b/tests/phpunit/CRM/Contribute/Form/Contribution/ConfirmTest.php @@ -120,16 +120,20 @@ class CRM_Contribute_Form_Contribution_ConfirmTest extends CiviUnitTestCase { 'skipLineItem' => 0, ); - $result = CRM_Contribute_BAO_Contribution_Utils::processConfirm($form, + $processConfirmResult = CRM_Contribute_BAO_Contribution_Utils::processConfirm($form, $form->_params, $contactID, $form->_values['financial_type_id'], 0, FALSE ); + + // Make sure that certain parameters are set on return from processConfirm + $this->assertEquals($form->_values['financial_type_id'], $processConfirmResult['financial_type_id']); + // Based on the processed contribution, complete transaction which update the contribution status based on payment result. - if (!empty($result['contribution'])) { + if (!empty($processConfirmResult['contribution'])) { $this->callAPISuccess('contribution', 'completetransaction', array( - 'id' => $result['contribution']->id, + 'id' => $processConfirmResult['contribution']->id, 'trxn_date' => date('Y-m-d'), 'payment_processor_id' => $paymentProcessorID, ));