Merge branch 'MDL-59093-master' of git://github.com/junpataleta/moodle

This commit is contained in:
Dan Poltawski 2017-05-31 11:09:06 +01:00
commit 67c70db593

View File

@ -1024,8 +1024,8 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
public function test_yearly_september_every_two_years_forever() {
global $DB;
// Change the start date for forever events to 9am on the month of September of the current year using the current day.
$this->change_event_startdate(date('Y09d\T090000'));
// Change the start date for forever events to 9am on the 2nd day of September of the current year.
$this->change_event_startdate(date('Y0902\T090000'));
$rrule = "FREQ=YEARLY;BYMONTH=9;INTERVAL=2"; // Forever event.
$mang = new rrule_manager($rrule);
@ -1038,7 +1038,7 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
$records = $DB->get_records('event', ['repeatid' => $this->event->id], 'timestart ASC', 'id, repeatid, timestart');
$interval = new DateInterval('P2Y');
$expecteddate = new DateTime(date('Y09d\T090000'));
$expecteddate = new DateTime(date('Y0902\T090000'));
foreach ($records as $record) {
$this->assertLessThanOrEqual($untiltimestamp, $record->timestart);
$this->assertEquals($expecteddate->format('Y-m-d H:i:s'), date('Y-m-d H:i:s', $record->timestart));