Skip to content

Commit

Permalink
Fix test method eventCreatePaid for php 8.2, address todo
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Feb 18, 2023
1 parent f53f3b2 commit a026de9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 3 additions & 2 deletions tests/phpunit/CRM/Event/Form/ParticipantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ public function testSubmitUnpaidPriceChangeWhileStillPending() {
$sum += $financialItem['amount'];
}
$this->assertEquals(55, $sum);

CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $participant['id'], 'participant', $contribution['id'], $this->eventFeeBlock, $lineItem);
$priceSetID = $this->ids['PriceSet']['event'];
$eventFeeBlock = CRM_Price_BAO_PriceSet::getSetDetail($priceSetID)[$priceSetID]['fields'];
CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $participant['id'], 'participant', $contribution['id'], $eventFeeBlock, $lineItem);
// Check that no payment records have been created.
// In https://lab.civicrm.org/dev/financial/issues/94 we had an issue where payments were created when none happend.
$payments = $this->callAPISuccess('Payment', 'get', [])['values'];
Expand Down
3 changes: 0 additions & 3 deletions tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1089,9 +1089,6 @@ protected function eventCreatePaid(array $params, array $options = [['name' => '
$this->ids['Event'][$key] = (int) $event['id'];
$this->ids['PriceSet'][$key] = $this->eventPriceSetCreate(55, 0, 'Radio', $options);
CRM_Price_BAO_PriceSet::addTo('civicrm_event', $event['id'], $this->ids['PriceSet'][$key]);
$priceSet = CRM_Price_BAO_PriceSet::getSetDetail($this->ids['PriceSet'][$key], TRUE, FALSE);
$priceSet = $priceSet[$this->ids['PriceSet'][$key]] ?? NULL;
$this->eventFeeBlock = $priceSet['fields'] ?? NULL;
return $event;
}

Expand Down

0 comments on commit a026de9

Please sign in to comment.