Skip to content

Commit

Permalink
Simply test, checkPaymentResult adds no value
Browse files Browse the repository at this point in the history
calling the checkPaymentResult function is actually decreasing readability here as the
simple array comparison is being made to look complex
  • Loading branch information
eileenmcnaughton committed Apr 1, 2019
1 parent cb7f35b commit 52746f6
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/phpunit/api/v3/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,19 @@ public function testRefundEmailReceipt($thousandSeparator) {
'contribution_id' => $contribution['id'],
'total_amount' => -30,
'trxn_date' => '2018-11-13 12:01:56',
]);
'sequential' => TRUE,
])['values'][0];

$this->checkPaymentResult($payment, [
$payment['id'] => [
'from_financial_account_id' => 7,
'to_financial_account_id' => 6,
'total_amount' => -30,
'status_id' => 1,
'is_payment' => 1,
],
]);
$expected = [
'from_financial_account_id' => 7,
'to_financial_account_id' => 6,
'total_amount' => -30,
'status_id' => 1,
'is_payment' => 1,
];
foreach ($expected as $key => $value) {
$this->assertEquals($expected[$key], $payment[$key], 'mismatch on key ' . $key);
}

$this->callAPISuccess('Payment', 'sendconfirmation', ['id' => $payment['id']]);
$mut->assertSubjects(['Refund Notification - Annual CiviCRM meet']);
Expand Down

0 comments on commit 52746f6

Please sign in to comment.