From 08e8bfe8119af515b5ecacbc0fb54416586222d8 Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Sat, 4 Feb 2023 18:01:39 +0000 Subject: [PATCH] [REF][PHP8.2] Refactor properties on CRM_Event_Form_SearchTest --- tests/phpunit/CRM/Event/Form/SearchTest.php | 22 +++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/CRM/Event/Form/SearchTest.php b/tests/phpunit/CRM/Event/Form/SearchTest.php index 3685cb9dc1..5155b19d1a 100644 --- a/tests/phpunit/CRM/Event/Form/SearchTest.php +++ b/tests/phpunit/CRM/Event/Form/SearchTest.php @@ -5,26 +5,36 @@ */ class CRM_Event_Form_SearchTest extends CiviUnitTestCase { + /** + * @var int + */ + private $individualID; + + /** + * @var array + */ + private $participantPrice; + public function setUp(): void { parent::setUp(); $this->individualID = $this->individualCreate(); - $this->event = $this->eventCreate(); - $this->priceFieldValues = $this->createPriceSet('event', $this->event, [ + $event = $this->eventCreate(); + $priceFieldValues = $this->createPriceSet('event', $event, [ 'html_type' => 'Radio', 'option_label' => ['1' => 'Radio Label A (inc. GST)', '2' => 'Radio Label B (inc. GST)'], 'option_name' => ['1' => 'Radio Label A', '2' => 'Radio Label B'], ]); - $this->priceFieldValues = $this->priceFieldValues['values']; + $priceFieldValues = $priceFieldValues['values']; $this->participantPrice = NULL; - foreach ($this->priceFieldValues as $priceFieldValue) { + foreach ($priceFieldValues as $priceFieldValue) { $this->participantPrice = $priceFieldValue; break; } $today = new DateTime(); - $this->participant = $this->participantCreate([ - 'event_id' => $this->event['id'], + $this->participantCreate([ + 'event_id' => $event['id'], 'contact_id' => $this->individualID, 'status_id' => 1, 'fee_level' => $this->participantPrice['label'], -- 2.25.1