MDL-59909 calendar: Try hard not to fail the adhoc task.
Triggering a fatal error in an adhoc task is bad. It will be retried indefinitely. Even though we are not sure how to get a module instance without a course module record, it is possible and should not kill the Moodle site.
This commit is contained in:
@@ -72,6 +72,13 @@ class core_completion_api_testcase extends advanced_testcase {
|
||||
$this->assertEquals(\core_completion\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED, $event->eventtype);
|
||||
$this->assertEquals($time, $event->timestart);
|
||||
$this->assertEquals($time, $event->timesort);
|
||||
|
||||
require_once($CFG->dirroot . '/course/lib.php');
|
||||
// Delete the module.
|
||||
course_delete_module($assign->cmid);
|
||||
|
||||
// Check we don't get a failure when called on a deleted module.
|
||||
\core_completion\api::update_completion_date_event($assign->cmid, 'assign', null, $time);
|
||||
}
|
||||
|
||||
public function test_update_completion_date_event_update() {
|
||||
|
||||
Reference in New Issue
Block a user