From c1850100aca829c51ebbf669bf8f14f079a7d258 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 23 Sep 2022 14:31:05 +1200 Subject: [PATCH] Cleanup in relevant test class --- tests/phpunit/api/v3/ContributionTest.php | 44 +++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 8c23a22d1e16..4bee728a778e 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -1365,7 +1365,7 @@ public function testCreateUpdateContributionChangeTotal() { * Function tests that line items, financial records are updated when pay later contribution is received. */ public function testCreateUpdateContributionPayLater() { - $contribParams = [ + $contributionParams = [ 'contact_id' => $this->_individualId, 'receive_date' => '2012-01-01', 'total_amount' => 100.00, @@ -1375,9 +1375,9 @@ public function testCreateUpdateContributionPayLater() { 'is_pay_later' => 1, ]; - $contribution = $this->callAPISuccess('contribution', 'create', $contribParams); + $contribution = $this->callAPISuccess('contribution', 'create', $contributionParams); - $newParams = array_merge($contribParams, [ + $newParams = array_merge($contributionParams, [ 'id' => $contribution['id'], 'contribution_status_id' => 1, ]); @@ -1393,7 +1393,7 @@ public function testCreateUpdateContributionPayLater() { */ public function testCreateUpdateContributionPaymentInstrument(): void { $instrumentId = $this->_addPaymentInstrument(); - $contribParams = [ + $contributionParams = [ 'contact_id' => $this->_individualId, 'total_amount' => 100.00, 'financial_type_id' => $this->_financialTypeId, @@ -1401,9 +1401,9 @@ public function testCreateUpdateContributionPaymentInstrument(): void { 'contribution_status_id' => 1, ]; - $contribution = $this->callAPISuccess('contribution', 'create', $contribParams); + $contribution = $this->callAPISuccess('contribution', 'create', $contributionParams); - $newParams = array_merge($contribParams, [ + $newParams = array_merge($contributionParams, [ 'id' => $contribution['id'], 'payment_instrument_id' => $instrumentId, ]); @@ -1420,7 +1420,7 @@ public function testCreateUpdateContributionPaymentInstrument(): void { */ public function testCreateUpdateNegativeContributionPaymentInstrument() { $instrumentId = $this->_addPaymentInstrument(); - $contribParams = [ + $contributionParams = [ 'contact_id' => $this->_individualId, 'total_amount' => -100.00, 'financial_type_id' => $this->_financialTypeId, @@ -1428,9 +1428,9 @@ public function testCreateUpdateNegativeContributionPaymentInstrument() { 'contribution_status_id' => 1, ]; - $contribution = $this->callAPISuccess('contribution', 'create', $contribParams); + $contribution = $this->callAPISuccess('contribution', 'create', $contributionParams); - $newParams = array_merge($contribParams, [ + $newParams = array_merge($contributionParams, [ 'id' => $contribution['id'], 'payment_instrument_id' => $instrumentId, ]); @@ -1686,8 +1686,8 @@ public function testCreateUpdateContributionRefundRefundNullTrxnIDPassedIn() { /** * Function tests invalid contribution status change. */ - public function testCreateUpdateContributionInValidStatusChange() { - $contribParams = [ + public function testCreateUpdateContributionInValidStatusChange(): void { + $contributionParams = [ 'contact_id' => 1, 'receive_date' => '2012-01-01', 'total_amount' => 100.00, @@ -1695,8 +1695,8 @@ public function testCreateUpdateContributionInValidStatusChange() { 'payment_instrument_id' => 1, 'contribution_status_id' => 1, ]; - $contribution = $this->callAPISuccess('contribution', 'create', $contribParams); - $newParams = array_merge($contribParams, [ + $contribution = $this->callAPISuccess('contribution', 'create', $contributionParams); + $newParams = array_merge($contributionParams, [ 'id' => $contribution['id'], 'contribution_status_id' => 2, ]); @@ -1710,7 +1710,7 @@ public function testCreateUpdateContributionInValidStatusChange() { * @throws \CRM_Core_Exception */ public function testCreateUpdateContributionCancelPending() { - $contribParams = [ + $contributionParams = [ 'contact_id' => $this->_individualId, 'receive_date' => '2012-01-01', 'total_amount' => 100.00, @@ -1720,8 +1720,8 @@ public function testCreateUpdateContributionCancelPending() { 'is_pay_later' => 1, ]; - $contribution = $this->callAPISuccess('contribution', 'create', $contribParams); - $newParams = array_merge($contribParams, [ + $contribution = $this->callAPISuccess('contribution', 'create', $contributionParams); + $newParams = array_merge($contributionParams, [ 'id' => $contribution['id'], 'contribution_status_id' => 3, 'cancel_date' => '2012-02-02 09:00', @@ -1741,7 +1741,7 @@ public function testCreateUpdateContributionCancelPending() { * @throws \CRM_Core_Exception */ public function testCreateUpdateContributionChangeFinancialType() { - $contribParams = [ + $contributionParams = [ 'contact_id' => $this->_individualId, 'receive_date' => '2012-01-01', 'total_amount' => 100.00, @@ -1750,8 +1750,8 @@ public function testCreateUpdateContributionChangeFinancialType() { 'contribution_status_id' => 1, ]; - $contribution = $this->callAPISuccess('contribution', 'create', $contribParams); - $newParams = array_merge($contribParams, [ + $contribution = $this->callAPISuccess('contribution', 'create', $contributionParams); + $newParams = array_merge($contributionParams, [ 'id' => $contribution['id'], 'financial_type_id' => 3, ]); @@ -1766,7 +1766,7 @@ public function testCreateUpdateContributionChangeFinancialType() { * @throws \CRM_Core_Exception */ public function testCreateUpdateContributionWithFeeAmountChangeFinancialType() { - $contribParams = [ + $contributionParams = [ 'contact_id' => $this->_individualId, 'receive_date' => '2012-01-01', 'total_amount' => 100.00, @@ -1776,8 +1776,8 @@ public function testCreateUpdateContributionWithFeeAmountChangeFinancialType() { 'contribution_status_id' => 1, ]; - $contribution = $this->callAPISuccess('contribution', 'create', $contribParams); - $newParams = array_merge($contribParams, [ + $contribution = $this->callAPISuccess('contribution', 'create', $contributionParams); + $newParams = array_merge($contributionParams, [ 'id' => $contribution['id'], 'financial_type_id' => 3, ]);