Skip to content

Commit

Permalink
CRM-20958 - api_v3_CaseTest::testCaseUpdate - Ignore creation/modific…
Browse files Browse the repository at this point in the history
…ation date.

Checking the `modified_date` is a bit racy -- depending on sub-second
performance/alignment, the original `Case` creation and the subsequent
`Case` update may have the same `modified_date` or may have different
`modified_date`.
  • Loading branch information
totten committed Aug 2, 2017
1 parent 3eec8ab commit dfe984e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/phpunit/api/v3/CaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,13 @@ public function testCaseUpdate() {
$params['subject'] = $case['subject'] = 'Something Else';
$this->callAPISuccess('case', 'create', $params);

// Verify that updated case is exactly equal to the original with new subject.
// Verify that updated case is equal to the original with new subject.
$result = $this->callAPISuccessGetSingle('Case', array('case_id' => $id));
// Modification dates are likely to differ by 0-2 sec. Check manually.
$this->assertTrue($result['modified_date'] >= $case['modified_date']);
unset($result['modified_date']);
unset($case['modified_date']);
// Everything else should be identical.
$this->assertAPIArrayComparison($result, $case);
}

Expand Down

0 comments on commit dfe984e

Please sign in to comment.