Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 39... Línea 39...
39
    }
39
    }
Línea 40... Línea 40...
40
 
40
 
41
    /**
41
    /**
42
     * Tests that the course progress percentage is returned correctly when we have only activity completion.
42
     * Tests that the course progress percentage is returned correctly when we have only activity completion.
43
     */
43
     */
44
    public function test_course_progress_percentage_with_just_activities() {
44
    public function test_course_progress_percentage_with_just_activities(): void {
Línea 45... Línea 45...
45
        global $DB;
45
        global $DB;
46
 
46
 
Línea 78... Línea 78...
78
    }
78
    }
Línea 79... Línea 79...
79
 
79
 
80
    /**
80
    /**
81
     * Tests that the course progress percentage is returned correctly when we have a course and activity completion.
81
     * Tests that the course progress percentage is returned correctly when we have a course and activity completion.
82
     */
82
     */
83
    public function test_course_progress_percentage_with_activities_and_course() {
83
    public function test_course_progress_percentage_with_activities_and_course(): void {
Línea 84... Línea 84...
84
        global $DB;
84
        global $DB;
85
 
85
 
Línea 123... Línea 123...
123
    /**
123
    /**
124
     * Tests that the course progress percentage is returned correctly for various grade to pass settings
124
     * Tests that the course progress percentage is returned correctly for various grade to pass settings
125
     *
125
     *
126
     * @covers \core_completion\progress::get_course_progress_percentage.
126
     * @covers \core_completion\progress::get_course_progress_percentage.
127
     */
127
     */
128
    public function test_course_progress_percentage_completion_state() {
128
    public function test_course_progress_percentage_completion_state(): void {
129
        global $DB, $CFG;
129
        global $DB, $CFG;
Línea 130... Línea 130...
130
 
130
 
Línea 131... Línea 131...
131
        require_once("{$CFG->dirroot}/completion/criteria/completion_criteria_activity.php");
131
        require_once("{$CFG->dirroot}/completion/criteria/completion_criteria_activity.php");
Línea 231... Línea 231...
231
    }
231
    }
Línea 232... Línea 232...
232
 
232
 
233
    /**
233
    /**
234
     * Tests that the course progress returns null when the course does not support it.
234
     * Tests that the course progress returns null when the course does not support it.
235
     */
235
     */
236
    public function test_course_progress_course_not_using_completion() {
236
    public function test_course_progress_course_not_using_completion(): void {
237
        // Create a course that does not use completion.
237
        // Create a course that does not use completion.
Línea 238... Línea 238...
238
        $course = $this->getDataGenerator()->create_course();
238
        $course = $this->getDataGenerator()->create_course();
239
 
239
 
240
        // Check that the result was null.
240
        // Check that the result was null.
Línea 241... Línea 241...
241
        $this->assertNull(\core_completion\progress::get_course_progress_percentage($course));
241
        $this->assertNull(\core_completion\progress::get_course_progress_percentage($course));
242
    }
242
    }
243
 
243
 
244
    /**
244
    /**
245
     * Tests that the course progress returns null when there are no activities that support it.
245
     * Tests that the course progress returns null when there are no activities that support it.
246
     */
246
     */
Línea 247... Línea 247...
247
    public function test_course_progress_no_activities_using_completion() {
247
    public function test_course_progress_no_activities_using_completion(): void {
248
        // Create a course that does support completion.
248
        // Create a course that does support completion.
Línea 256... Línea 256...
256
    }
256
    }
Línea 257... Línea 257...
257
 
257
 
258
    /**
258
    /**
259
     * Tests that the course progress returns null for a not tracked for completion user in a course.
259
     * Tests that the course progress returns null for a not tracked for completion user in a course.
260
     */
260
     */
261
    public function test_course_progress_not_tracked_user() {
261
    public function test_course_progress_not_tracked_user(): void {
Línea 262... Línea 262...
262
        global $DB;
262
        global $DB;
263
 
263