From e255b57ab6016af990da131893d6619ce6576fb2 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 2 Nov 2019 18:21:36 +1300 Subject: [PATCH] Php 7.3 fix - don't mis-use continue Also fix some casing --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 10 +++++----- tests/phpunit/api/v3/CustomValueTest.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index d83e6ce442..dadce65691 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -85,7 +85,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { * Track tables we have modified during a test. * @var array */ - protected $_tablesToTruncate = array(); + protected $_tablesToTruncate = []; /** * @var array of temporary directory names @@ -1522,7 +1522,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { $params = array('title' => $function); $entity = substr(basename($filename), 0, strlen(basename($filename)) - 8); $params['extends'] = $entity ? $entity : 'Contact'; - $customGroup = $this->CustomGroupCreate($params); + $customGroup = $this->customGroupCreate($params); $customField = $this->customFieldCreate(array('custom_group_id' => $customGroup['id'], 'label' => $function)); CRM_Core_PseudoConstant::flush(); @@ -1545,7 +1545,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { $params = array('title' => $function); $entity = substr(basename($filename), 0, strlen(basename($filename)) - 8); $params['extends'] = $entity ? $entity : 'Contact'; - $customGroup = $this->CustomGroupCreate($params); + $customGroup = $this->customGroupCreate($params); $customField = $this->customFieldCreate(array('custom_group_id' => $customGroup['id'], 'label' => $function, 'html_type' => 'Multi-Select', 'default_value' => 1)); CRM_Core_PseudoConstant::flush(); $options = [ @@ -1852,10 +1852,10 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) $fields = $this->callAPISuccess($entity, 'getfields', array('version' => 3, 'action' => 'get')); foreach ($fields['values'] as $field => $settings) { if (array_key_exists($field, $result)) { - $keys[CRM_Utils_Array::Value('name', $settings, $field)] = $field; + $keys[CRM_Utils_Array::value('name', $settings, $field)] = $field; } else { - $keys[CRM_Utils_Array::Value('name', $settings, $field)] = CRM_Utils_Array::value('name', $settings, $field); + $keys[CRM_Utils_Array::value('name', $settings, $field)] = CRM_Utils_Array::value('name', $settings, $field); } $type = CRM_Utils_Array::value('type', $settings); if ($type == CRM_Utils_Type::T_DATE) { diff --git a/tests/phpunit/api/v3/CustomValueTest.php b/tests/phpunit/api/v3/CustomValueTest.php index 378150e185..c23f1927e1 100644 --- a/tests/phpunit/api/v3/CustomValueTest.php +++ b/tests/phpunit/api/v3/CustomValueTest.php @@ -282,7 +282,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase { case '>=': case '<=': if ($isSerialized) { - continue; + break; } // To be precise in for these operator we can't just rely on one contact, // hence creating multiple contact with custom value less/more then $selectedValue respectively -- 2.25.1