From 32c1003dcb4ad6652e16946e51504e9ee81e96c4 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 31 Jul 2017 19:55:18 -0700 Subject: [PATCH] CRM-20958 - api_v3_CaseTest::testCaseUpdate - Ignore creation/modification 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`. --- tests/phpunit/api/v3/CaseTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/api/v3/CaseTest.php b/tests/phpunit/api/v3/CaseTest.php index a1820df11e..0d429bd2bb 100644 --- a/tests/phpunit/api/v3/CaseTest.php +++ b/tests/phpunit/api/v3/CaseTest.php @@ -193,8 +193,13 @@ class api_v3_CaseTest extends CiviCaseTestCase { $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); } -- 2.25.1