mirror of
https://github.com/moodle/moodle.git
synced 2025-05-02 06:22:59 +02:00
MDL-58810 calendar: Add coverage for UUID in recurring events
This commit is contained in:
parent
48ad73619f
commit
bf57bde20d
@ -466,11 +466,21 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
|
||||
$records = $DB->get_records('event', array('repeatid' => $this->event->id), 'timestart ASC');
|
||||
|
||||
$expecteddate = clone($startdatetime);
|
||||
$first = true;
|
||||
foreach ($records as $record) {
|
||||
$this->assertLessThanOrEqual($until, $record->timestart);
|
||||
$this->assertEquals($expecteddate->format('Y-m-d H:i:s'), date('Y-m-d H:i:s', $record->timestart));
|
||||
// Go to next iteration.
|
||||
$expecteddate->add($interval);
|
||||
// Check UUID.
|
||||
if ($first) {
|
||||
// The first instance of the event contains the UUID.
|
||||
$this->assertEquals('uuid', $record->uuid);
|
||||
$first = false;
|
||||
} else {
|
||||
// Succeeding instances will not contain the UUID.
|
||||
$this->assertEmpty($record->uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user