avoid error-suppression operator
authordemeritcowboy <demeritcowboy@hotmail.com>
Mon, 16 Aug 2021 13:41:34 +0000 (09:41 -0400)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Mon, 16 Aug 2021 13:41:34 +0000 (09:41 -0400)
tests/phpunit/CRM/Core/RegionTest.php

index e11dc213c5ecf6faec6c9ac5f3834aa6cda0fa29..d009bb4b7969d9db30442cf3d92a8af50eabe023 100644 (file)
@@ -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';