Skip to content

Commit

Permalink
REF/tests - Simplify inline conditionals with Elvis
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Aug 24, 2023
1 parent d894dd5 commit d717e4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ public function CustomGroupMultipleCreateWithFields($params = []) {
public function entityCustomGroupWithSingleFieldCreate($function, $filename): array {
$params = ['title' => $function];
$entity = substr(basename($filename), 0, strlen(basename($filename)) - 8);
$params['extends'] = $entity ? $entity : 'Contact';
$params['extends'] = $entity ?: 'Contact';
$customGroup = $this->customGroupCreate($params);
$customField = $this->customFieldCreate(['custom_group_id' => $customGroup['id'], 'label' => $function]);
CRM_Core_PseudoConstant::flush();
Expand All @@ -1453,7 +1453,7 @@ public function entityCustomGroupWithSingleFieldCreate($function, $filename): ar
public function entityCustomGroupWithSingleStringMultiSelectFieldCreate($function, $filename) {
$params = ['title' => $function];
$entity = substr(basename($filename), 0, strlen(basename($filename)) - 8);
$params['extends'] = $entity ? $entity : 'Contact';
$params['extends'] = $entity ?: 'Contact';
$customGroup = $this->customGroupCreate($params);
$customField = $this->customFieldCreate(['custom_group_id' => $customGroup['id'], 'label' => $function, 'html_type' => 'Multi-Select', 'default_value' => 1]);
CRM_Core_PseudoConstant::flush();
Expand Down

0 comments on commit d717e4f

Please sign in to comment.