From 814295cb925b87ba53344de4ece1cb57a9f64f05 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Mon, 16 Aug 2021 09:41:34 -0400 Subject: [PATCH] avoid error-suppression operator --- tests/phpunit/CRM/Core/RegionTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/CRM/Core/RegionTest.php b/tests/phpunit/CRM/Core/RegionTest.php index e11dc213c5..d009bb4b79 100644 --- a/tests/phpunit/CRM/Core/RegionTest.php +++ b/tests/phpunit/CRM/Core/RegionTest.php @@ -23,7 +23,12 @@ class CRM_Core_RegionTest extends CiviUnitTestCase { * @return \CRM_Core_Resources_CollectionInterface */ public function createEmptyCollection() { - @++Civi::$statics['CRM_Core_RegionTestId']; + if (empty(Civi::$statics['CRM_Core_RegionTestId'])) { + Civi::$statics['CRM_Core_RegionTestId'] = 1; + } + else { + ++Civi::$statics['CRM_Core_RegionTestId']; + } $r = new CRM_Core_Region('region_' . Civi::$statics['CRM_Core_RegionTestId']); $r->filter(function($snippet) { return $snippet['name'] !== 'default'; -- 2.25.1