"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mod/feedback/tests/lib_test.php" between
moodle-3.6.5.tgz and moodle-3.6.6.tgz

About: moodle is a learning management system for producing Internet-based course Web sites. Latest 3.6 release.

lib_test.php  (moodle-3.6.5.tgz):lib_test.php  (moodle-3.6.6.tgz)
skipping to change at line 544 skipping to change at line 544
// User2 checking their events. // User2 checking their events.
$actionevent = mod_feedback_core_calendar_provide_event_action($event, $ factory, $user2->id); $actionevent = mod_feedback_core_calendar_provide_event_action($event, $ factory, $user2->id);
$this->assertNull($actionevent); $this->assertNull($actionevent);
// User2 checking $user's events. // User2 checking $user's events.
$actionevent = mod_feedback_core_calendar_provide_event_action($event, $ factory, $user->id); $actionevent = mod_feedback_core_calendar_provide_event_action($event, $ factory, $user->id);
$this->assertNull($actionevent); $this->assertNull($actionevent);
} }
public function test_feedback_core_calendar_provide_event_action_already_com
pleted() {
$this->resetAfterTest();
set_config('enablecompletion', 1);
$this->setAdminUser();
// Create the activity.
$course = $this->getDataGenerator()->create_course(array('enablecompleti
on' => 1));
$feedback = $this->getDataGenerator()->create_module('feedback', array('
course' => $course->id),
array('completion' => 2, 'completionview' => 1, 'completionexpected'
=> time() + DAYSECS));
// Get some additional data.
$cm = get_coursemodule_from_instance('feedback', $feedback->id);
// Create a calendar event.
$event = $this->create_action_event($course->id, $feedback->id,
\core_completion\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED
);
// Mark the activity as completed.
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
// Create an action factory.
$factory = new \core_calendar\action_factory();
// Decorate action event.
$actionevent = mod_feedback_core_calendar_provide_event_action($event, $
factory);
// Ensure result was null.
$this->assertNull($actionevent);
}
public function test_feedback_core_calendar_provide_event_action_already_com
pleted_for_user() {
$this->resetAfterTest();
set_config('enablecompletion', 1);
$this->setAdminUser();
// Create the activity.
$course = $this->getDataGenerator()->create_course(array('enablecompleti
on' => 1));
$feedback = $this->getDataGenerator()->create_module('feedback', array('
course' => $course->id),
array('completion' => 2, 'completionview' => 1, 'completionexpected'
=> time() + DAYSECS));
// Enrol a student in the course.
$student = $this->getDataGenerator()->create_and_enrol($course, 'student
');
// Get some additional data.
$cm = get_coursemodule_from_instance('feedback', $feedback->id);
// Create a calendar event.
$event = $this->create_action_event($course->id, $feedback->id,
\core_completion\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED
);
// Mark the activity as completed for the student.
$completion = new completion_info($course);
$completion->set_module_viewed($cm, $student->id);
// Create an action factory.
$factory = new \core_calendar\action_factory();
// Decorate action event for the student.
$actionevent = mod_feedback_core_calendar_provide_event_action($event, $
factory, $student->id);
// Ensure result was null.
$this->assertNull($actionevent);
}
/** /**
* Creates an action event. * Creates an action event.
* *
* @param int $courseid The course id. * @param int $courseid The course id.
* @param int $instanceid The feedback id. * @param int $instanceid The feedback id.
* @param string $eventtype The event type. eg. FEEDBACK_EVENT_TYPE_OPEN. * @param string $eventtype The event type. eg. FEEDBACK_EVENT_TYPE_OPEN.
* @return bool|calendar_event * @return bool|calendar_event
*/ */
private function create_action_event($courseid, $instanceid, $eventtype) { private function create_action_event($courseid, $instanceid, $eventtype) {
$event = new stdClass(); $event = new stdClass();
 End of changes. 1 change blocks. 
0 lines changed or deleted 78 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)