// Enrol the day before the course startdate, because if we create a course today its default
// startdate is tomorrow, and we would never realise why the enrolments do not work.
$plugin->enrol_user($instance, $user->id, $role->id, $course->startdate - 86400, 0);
// Enrol the day before the course startdate, because if we create a course today its default
// startdate is tomorrow, and we would never realise why the enrolments do not work.
$plugin->enrol_user($instance, $user->id, $role->id, $course->startdate - 86400, 0);