From: Seamus Lee Date: Wed, 10 Jun 2020 22:45:53 +0000 (+1000) Subject: [REF] Using ternary operation without nesting is deprecated and also using methods... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f2aaaf305eb2a1e03e32c0d1f7cc367f3428c5e9;p=civicrm-core.git [REF] Using ternary operation without nesting is deprecated and also using methods and properly instanciate the CiviCase Info object in test --- 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; }