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);
$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));