From 52746f6a3a229e8020e63cc70f109b759f43d3d0 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 1 Apr 2019 17:31:21 +1300 Subject: [PATCH] Simply test, checkPaymentResult adds no value calling the checkPaymentResult function is actually decreasing readability here as the simple array comparison is being made to look complex --- tests/phpunit/api/v3/PaymentTest.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/api/v3/PaymentTest.php b/tests/phpunit/api/v3/PaymentTest.php index fbb5261cfc..0c49ce88f4 100644 --- a/tests/phpunit/api/v3/PaymentTest.php +++ b/tests/phpunit/api/v3/PaymentTest.php @@ -197,17 +197,19 @@ class api_v3_PaymentTest extends CiviUnitTestCase { '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']); -- 2.25.1