Skip to content

Commit

Permalink
MDL-47449 completion: Ignore timemodified when comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Aug 14, 2015
1 parent 504c979 commit 97b1a48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/tests/completionlib_test.php
Expand Up @@ -195,9 +195,11 @@ public function test_update_state() {
$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.
Expand All @@ -217,9 +219,11 @@ public function test_update_state() {
$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);
}

Expand Down

0 comments on commit 97b1a48

Please sign in to comment.