From f4d98b6f4803462a763f6ed172ff246a73429f81 Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Sun, 5 Feb 2023 12:20:38 +0000 Subject: [PATCH] [REF][PHP8.2] Declare dynamic property in two SMS tests --- tests/phpunit/CRM/SMS/BAO/ProviderTest.php | 11 +++++++++-- tests/phpunit/CRM/SMS/PreviewTest.php | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/CRM/SMS/BAO/ProviderTest.php b/tests/phpunit/CRM/SMS/BAO/ProviderTest.php index 9ca1c34217..699049b02e 100644 --- a/tests/phpunit/CRM/SMS/BAO/ProviderTest.php +++ b/tests/phpunit/CRM/SMS/BAO/ProviderTest.php @@ -18,13 +18,20 @@ */ class CRM_SMS_BAO_ProviderTest extends CiviUnitTestCase { + /** + * Reference to option value in sms_provider_name group. + * + * @var int + */ + private $optionValueID; + /** * Set Up Funtion */ public function setUp(): void { parent::setUp(); $option = $this->callAPISuccess('option_value', 'create', ['option_group_id' => 'sms_provider_name', 'name' => 'test_provider_name', 'label' => 'test_provider_name', 'value' => 1]); - $this->option_value = $option['id']; + $this->optionValueID = $option['id']; } /** @@ -32,7 +39,7 @@ class CRM_SMS_BAO_ProviderTest extends CiviUnitTestCase { */ public function tearDown(): void { parent::tearDown(); - $this->callAPISuccess('option_value', 'delete', ['id' => $this->option_value]); + $this->callAPISuccess('option_value', 'delete', ['id' => $this->optionValueID]); } /** diff --git a/tests/phpunit/CRM/SMS/PreviewTest.php b/tests/phpunit/CRM/SMS/PreviewTest.php index c3dd21950f..c44072c1bd 100644 --- a/tests/phpunit/CRM/SMS/PreviewTest.php +++ b/tests/phpunit/CRM/SMS/PreviewTest.php @@ -7,13 +7,20 @@ */ class CRM_SMS_PreviewTest extends CiviUnitTestCase { + /** + * Reference to option value in sms_provider_name group. + * + * @var int + */ + private $optionValueID; + /** * Set Up Function */ public function setUp(): void { parent::setUp(); $option = $this->callAPISuccess('option_value', 'create', ['option_group_id' => 'sms_provider_name', 'name' => 'test_provider_name', 'label' => 'Test Provider Label', 'value' => 1]); - $this->option_value = $option['id']; + $this->optionValueID = $option['id']; } /** @@ -21,7 +28,7 @@ class CRM_SMS_PreviewTest extends CiviUnitTestCase { */ public function tearDown(): void { parent::tearDown(); - $this->callAPISuccess('option_value', 'delete', ['id' => $this->option_value]); + $this->callAPISuccess('option_value', 'delete', ['id' => $this->optionValueID]); } /** -- 2.25.1