From 3ee60271fa2691dcbbfe6032eed13d6889af0ee1 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Mon, 2 Oct 2017 09:17:33 +0800 Subject: [PATCH] MDL-60306 calendar: Fix rrule_manager unit test * The calculation of the expected date should depend on the comparison with the start date's date and not it's exact timestamp. --- calendar/tests/rrule_manager_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calendar/tests/rrule_manager_test.php b/calendar/tests/rrule_manager_test.php index ca285085b86..a6e2531e658 100644 --- a/calendar/tests/rrule_manager_test.php +++ b/calendar/tests/rrule_manager_test.php @@ -872,7 +872,7 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase { $records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart'); $expecteddate = new DateTime('first Monday of this month'); // Move to the next interval's first Monday if the calculated start date is after this month's first Monday. - if ($expecteddate->getTimestamp() < $startdatetime->getTimestamp()) { + if ($expecteddate->getTimestamp() < $startdate->getTimestamp()) { $expecteddate->add($interval); $expecteddate->modify('first Monday of this month'); }