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.
This commit is contained in:
Jun Pataleta
2017-10-02 09:18:57 +08:00
parent c2d1467a7d
commit 3ee60271fa
+1 -1
View File
@@ -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');
}