MDL-63275 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
2018-09-04 13:46:41 +02:00
committed by David Monllao
parent 8c04f87af5
commit 7db66a5fe2
+1 -1
View File
@@ -862,7 +862,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');
}