From: demeritcowboy Date: Mon, 13 Nov 2023 15:17:16 +0000 (-0500) Subject: update test X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=be95f8ecee09c635acd95d50759c8d6a320f7cf5;p=civicrm-core.git update test --- diff --git a/tests/phpunit/CRM/Case/BAO/CaseTest.php b/tests/phpunit/CRM/Case/BAO/CaseTest.php index 0dd3ce1ee2..c687ab90cc 100644 --- a/tests/phpunit/CRM/Case/BAO/CaseTest.php +++ b/tests/phpunit/CRM/Case/BAO/CaseTest.php @@ -111,16 +111,7 @@ class CRM_Case_BAO_CaseTest extends CiviUnitTestCase { $caseRoles = CRM_Case_BAO_Case::getCaseRoles($loggedInUser, $caseId); $this->assertEquals($caseCount, $upcomingCases, 'Upcoming case count must be ' . $caseCount); - if ($caseCount === 0) { - // If there really are 0 cases then there won't be any subelements for - // status and count, so we get a false error if we use the assertEquals - // check since it tries to get a subelement on type int. In this case - // the summary rows are just the case type pseudoconstant list. - $this->assertSame(array_flip(CRM_Case_PseudoConstant::caseType()), $summary['rows']); - } - else { - $this->assertEquals($caseCount, $summary['rows']['Housing Support']['Ongoing']['count'], 'Housing Support Ongoing case summary must be ' . $caseCount); - } + $this->assertEquals($caseCount, (int) $summary['rows']['Housing Support']['Ongoing']['count'], 'Housing Support Ongoing case summary must be ' . $caseCount); $this->assertEquals($caseCount, count($caseRoles), 'Total case roles for logged in users must be ' . $caseCount); }