本文整理匯總了PHP中completion_completion::get_record_data方法的典型用法代碼示例。如果您正苦於以下問題:PHP completion_completion::get_record_data方法的具體用法?PHP completion_completion::get_record_data怎麽用?PHP completion_completion::get_record_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類completion_completion
的用法示例。
在下文中一共展示了completion_completion::get_record_data方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_course_completed_event
/**
* Test course completed event.
*/
public function test_course_completed_event()
{
global $USER;
$this->setup_data();
$this->setAdminUser();
$completionauto = array('completion' => COMPLETION_TRACKING_AUTOMATIC);
$ccompletion = new completion_completion(array('course' => $this->course->id, 'userid' => $this->user->id));
// Mark course as complete and get triggered event.
$sink = $this->redirectEvents();
$ccompletion->mark_complete();
$events = $sink->get_events();
$event = reset($events);
$this->assertInstanceOf('\\core\\event\\course_completed', $event);
$this->assertEquals($this->course->id, $event->get_record_snapshot('course_completions', $event->objectid)->course);
$this->assertEquals($this->course->id, $event->courseid);
$this->assertEquals($USER->id, $event->userid);
$this->assertEquals($this->user->id, $event->relateduserid);
$this->assertEquals(context_course::instance($this->course->id), $event->get_context());
$this->assertInstanceOf('moodle_url', $event->get_url());
$data = $ccompletion->get_record_data();
$this->assertEventLegacyData($data, $event);
}