本文整理汇总了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);
}