From f2aaaf305eb2a1e03e32c0d1f7cc367f3428c5e9 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 11 Jun 2020 08:45:53 +1000 Subject: [PATCH] [REF] Using ternary operation without nesting is deprecated and also using methods and properly instanciate the CiviCase Info object in test --- CRM/Core/Form.php | 2 +- tests/phpunit/CRM/Activity/BAO/ActivityTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index efc615f3ca..d479943e37 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -1469,7 +1469,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $options = $info['values']; } if (!array_key_exists('placeholder', $props)) { - $props['placeholder'] = $required ? ts('- select -') : CRM_Utils_Array::value('context', $props) == 'search' ? ts('- any -') : ts('- none -'); + $props['placeholder'] = $required ? ts('- select -') : (CRM_Utils_Array::value('context', $props) == 'search' ? ts('- any -') : ts('- none -')); } // Handle custom field if (strpos($name, 'custom_') === 0 && is_numeric($name[7])) { diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index 8dff8bcfc3..ece7b501bb 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -1613,6 +1613,7 @@ $text protected function setShowCaseActivitiesInCore(bool $val) { Civi::settings()->set('civicaseShowCaseActivities', $val ? 1 : 0); CRM_Core_Component::getEnabledComponents(); + Civi::$statics['CRM_Core_Component']['info']['CiviCase'] = new CRM_Case_Info('CiviCase', 'CRM_Case', 7); Civi::$statics['CRM_Core_Component']['info']['CiviCase']->info['showActivitiesInCore'] = $val; } -- 2.25.1