Skip to content

Commit

Permalink
Add unit test coverage for financial_type_id
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Apr 28, 2018
1 parent a427c49 commit 1adbeb3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/phpunit/CRM/Contribute/Form/Contribution/ConfirmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,20 @@ public function testPaynowPayment() {
'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,
));
Expand Down

0 comments on commit 1adbeb3

Please sign in to comment.