Skip to content

Commit

Permalink
Cleanup in relevant test class
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Sep 23, 2022
1 parent d51ea75 commit c185010
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions tests/phpunit/api/v3/ContributionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
]);
Expand All @@ -1393,17 +1393,17 @@ 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,
'payment_instrument_id' => 4,
'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,
]);
Expand All @@ -1420,17 +1420,17 @@ 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,
'payment_instrument_id' => 4,
'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,
]);
Expand Down Expand Up @@ -1686,17 +1686,17 @@ 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,
'financial_type_id' => 1,
'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,
]);
Expand All @@ -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,
Expand All @@ -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',
Expand All @@ -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,
Expand All @@ -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,
]);
Expand All @@ -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,
Expand All @@ -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,
]);
Expand Down

0 comments on commit c185010

Please sign in to comment.