Merge branch 'MDL-69256-master' of git://github.com/andrewnicols/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 19 Apr 2021 22:04:48 +0000 (00:04 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 19 Apr 2021 22:04:48 +0000 (00:04 +0200)
lib/tests/completion_daily_task_test.php

index e694ac0..263b92d 100644 (file)
@@ -114,10 +114,12 @@ class core_completion_cron_task_testcase extends advanced_testcase {
 
         // Get s1's completion record from c1.
         $s1c1 = $DB->get_record('course_completions', ['userid' => $s1->id, 'course' => $c1->id]);
-        $this->assertEquals(userdate($now), userdate($s1c1->timeenrolled));
+        $this->assertGreaterThanOrEqual($now, $s1c1->timeenrolled);
+        $this->assertLessThanOrEqual(time(), $s1c1->timeenrolled);
 
         // Get s2's completion record from c1.
         $s2c1 = $DB->get_record('course_completions', ['userid' => $s2->id, 'course' => $c1->id]);
-        $this->assertEquals(userdate($now), userdate($s2c1->timeenrolled));
+        $this->assertGreaterThanOrEqual($now, $s2c1->timeenrolled);
+        $this->assertLessThanOrEqual(time(), $s2c1->timeenrolled);
     }
 }