Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 31... Línea 31...
31
     */
31
     */
32
    public function setUp(): void {
32
    public function setUp(): void {
33
        $this->resetAfterTest();
33
        $this->resetAfterTest();
34
    }
34
    }
Línea 35... Línea 35...
35
 
35
 
36
    public function test_update_completion_date_event() {
36
    public function test_update_completion_date_event(): void {
Línea 37... Línea 37...
37
        global $CFG, $DB;
37
        global $CFG, $DB;
Línea 38... Línea 38...
38
 
38
 
Línea 70... Línea 70...
70
 
70
 
71
        // Check we don't get a failure when called on a deleted module.
71
        // Check we don't get a failure when called on a deleted module.
72
        \core_completion\api::update_completion_date_event($assign->cmid, 'assign', null, $time);
72
        \core_completion\api::update_completion_date_event($assign->cmid, 'assign', null, $time);
Línea 73... Línea 73...
73
    }
73
    }
74
 
74
 
Línea 75... Línea 75...
75
    public function test_update_completion_date_event_update() {
75
    public function test_update_completion_date_event_update(): void {
Línea 76... Línea 76...
76
        global $CFG, $DB;
76
        global $CFG, $DB;
Línea 105... Línea 105...
105
        $this->assertEquals(\core_completion\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED, $event->eventtype);
105
        $this->assertEquals(\core_completion\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED, $event->eventtype);
106
        $this->assertEquals($time + DAYSECS, $event->timestart);
106
        $this->assertEquals($time + DAYSECS, $event->timestart);
107
        $this->assertEquals($time + DAYSECS, $event->timesort);
107
        $this->assertEquals($time + DAYSECS, $event->timesort);
108
    }
108
    }
Línea 109... Línea 109...
109
 
109
 
110
    public function test_update_completion_date_event_delete() {
110
    public function test_update_completion_date_event_delete(): void {
Línea 111... Línea 111...
111
        global $CFG, $DB;
111
        global $CFG, $DB;
Línea 112... Línea 112...
112
 
112
 
Línea 128... Línea 128...
128
 
128
 
129
        // Check that there is no event in the database.
129
        // Check that there is no event in the database.
130
        $this->assertEquals(0, $DB->count_records('event'));
130
        $this->assertEquals(0, $DB->count_records('event'));
Línea 131... Línea 131...
131
    }
131
    }
132
 
132
 
Línea 133... Línea 133...
133
    public function test_update_completion_date_event_completion_disabled() {
133
    public function test_update_completion_date_event_completion_disabled(): void {
Línea 134... Línea 134...
134
        global $CFG, $DB;
134
        global $CFG, $DB;
Línea 148... Línea 148...
148
 
148
 
149
        // Check that there is no event in the database.
149
        // Check that there is no event in the database.
150
        $this->assertEquals(0, $DB->count_records('event'));
150
        $this->assertEquals(0, $DB->count_records('event'));
Línea 151... Línea 151...
151
    }
151
    }
152
 
152
 
Línea 153... Línea 153...
153
    public function test_update_completion_date_event_update_completion_disabled() {
153
    public function test_update_completion_date_event_update_completion_disabled(): void {
Línea 154... Línea 154...
154
        global $CFG, $DB;
154
        global $CFG, $DB;
Línea 186... Línea 186...
186
        $this->assertEquals(\core_completion\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED, $event->eventtype);
186
        $this->assertEquals(\core_completion\api::COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED, $event->eventtype);
187
        $this->assertEquals($time, $event->timestart);
187
        $this->assertEquals($time, $event->timestart);
188
        $this->assertEquals($time, $event->timesort);
188
        $this->assertEquals($time, $event->timesort);
189
    }
189
    }
Línea 190... Línea 190...
190
 
190
 
191
    public function test_update_completion_date_event_delete_completion_disabled() {
191
    public function test_update_completion_date_event_delete_completion_disabled(): void {
Línea 192... Línea 192...
192
        global $CFG, $DB;
192
        global $CFG, $DB;
Línea 193... Línea 193...
193
 
193
 
Línea 215... Línea 215...
215
    }
215
    }
Línea 216... Línea 216...
216
 
216
 
217
    /**
217
    /**
218
     * Test for mark_course_completions_activity_criteria().
218
     * Test for mark_course_completions_activity_criteria().
219
     */
219
     */
220
    public function test_mark_course_completions_activity_criteria() {
220
    public function test_mark_course_completions_activity_criteria(): void {
221
        global $DB, $CFG;
221
        global $DB, $CFG;
222
        require_once($CFG->dirroot.'/completion/criteria/completion_criteria_activity.php');
222
        require_once($CFG->dirroot.'/completion/criteria/completion_criteria_activity.php');
Línea 223... Línea 223...
223
        $this->resetAfterTest(true);
223
        $this->resetAfterTest(true);
Línea 291... Línea 291...
291
 
291
 
292
    /**
292
    /**
293
     * Test for mark_course_completions_activity_criteria() with different completionpassgrade settings.
293
     * Test for mark_course_completions_activity_criteria() with different completionpassgrade settings.
294
     * @covers ::mark_course_completions_activity_criteria
294
     * @covers ::mark_course_completions_activity_criteria
295
     */
295
     */
296
    public function test_mark_course_completions_activity_criteria_completion_states() {
296
    public function test_mark_course_completions_activity_criteria_completion_states(): void {
297
        global $DB, $CFG;
297
        global $DB, $CFG;
298
        require_once($CFG->dirroot . '/completion/criteria/completion_criteria_activity.php');
298
        require_once($CFG->dirroot . '/completion/criteria/completion_criteria_activity.php');
Línea 299... Línea 299...
299
        $this->resetAfterTest(true);
299
        $this->resetAfterTest(true);