From 834444950c9edf15a4b7fda58a57d5d0f0d1c291 Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Sat, 11 Feb 2023 15:43:09 +0000 Subject: [PATCH] [REF][PHP8.2] Stop use of dynamic property in AdditionalPaymentTest --- .../CRM/Event/BAO/AdditionalPaymentTest.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php index e4ac8c2d20..f92ac1a7f9 100644 --- a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php +++ b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php @@ -23,6 +23,13 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { */ protected $contactID; + /** + * Event ID. + * + * @var int + */ + protected $eventID; + /** * Set up. * @@ -32,7 +39,7 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { parent::setUp(); $this->contactID = $this->individualCreate(); $event = $this->eventCreate(); - $this->_eventId = $event['id']; + $this->eventID = $event['id']; } /** @@ -41,7 +48,7 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception */ public function tearDown(): void { - $this->eventDelete($this->_eventId); + $this->eventDelete($this->eventID); $this->quickCleanUpFinancialEntities(); parent::tearDown(); } @@ -72,7 +79,7 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { */ protected function addParticipantWithPayment($feeTotal, $actualPaidAmt, $participantParams = [], $contributionParams = []) { $priceSetId = $this->eventPriceSetCreate($feeTotal); - CRM_Price_BAO_PriceSet::addTo('civicrm_event', $this->_eventId, $priceSetId); + CRM_Price_BAO_PriceSet::addTo('civicrm_event', $this->eventID, $priceSetId); // -- processing priceSet using the BAO $lineItems = []; $priceSet = CRM_Price_BAO_PriceSet::getSetDetail($priceSetId, TRUE, FALSE); @@ -93,13 +100,13 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { 'send_receipt' => 1, 'is_test' => 0, 'is_pay_later' => 0, - 'event_id' => $this->_eventId, + 'event_id' => $this->eventID, 'register_date' => date('Y-m-d') . " 00:00:00", 'role_id' => 1, 'status_id' => 14, - 'source' => 'Event_' . $this->_eventId, + 'source' => 'Event_' . $this->eventID, 'contact_id' => $this->contactID, - 'note' => 'Note added for Event_' . $this->_eventId, + 'note' => 'Note added for Event_' . $this->eventID, 'fee_level' => 'Price_Field - 55', ], $participantParams -- 2.25.1