From 305ee3fc2796a660c7404e3141db04a2ee7f4441 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 6 Mar 2015 10:12:19 +0800 Subject: [PATCH] MDL-47449 completion: Ignore timemodified when comparing --- lib/tests/completionlib_test.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/tests/completionlib_test.php b/lib/tests/completionlib_test.php index 150bafc789d..b67e9578167 100644 --- a/lib/tests/completionlib_test.php +++ b/lib/tests/completionlib_test.php @@ -195,9 +195,11 @@ class core_completionlib_testcase extends advanced_testcase { $changed = clone($current); $changed->timemodified = time(); $changed->completionstate = COMPLETION_INCOMPLETE; + $comparewith = new phpunit_constraint_object_is_equal_with_exceptions($changed); + $comparewith->add_exception('timemodified', 'assertGreaterThanOrEqual'); $c->expects($this->at(2)) ->method('internal_set_data') - ->with($cm, $changed); + ->with($cm, $comparewith); $c->update_state($cm, COMPLETION_INCOMPLETE); // Auto, change state. @@ -217,9 +219,11 @@ class core_completionlib_testcase extends advanced_testcase { $changed = clone($current); $changed->timemodified = time(); $changed->completionstate = COMPLETION_COMPLETE_PASS; + $comparewith = new phpunit_constraint_object_is_equal_with_exceptions($changed); + $comparewith->add_exception('timemodified', 'assertGreaterThanOrEqual'); $c->expects($this->at(3)) ->method('internal_set_data') - ->with($cm, $changed); + ->with($cm, $comparewith); $c->update_state($cm, COMPLETION_COMPLETE_PASS); }