$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);
}