Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 43... Línea 43...
43
class locallib_test extends \advanced_testcase {
43
class locallib_test extends \advanced_testcase {
Línea 44... Línea 44...
44
 
44
 
45
    /**
45
    /**
46
     * Test duplicating a lesson page element.
46
     * Test duplicating a lesson page element.
47
     */
47
     */
48
    public function test_duplicate_page() {
48
    public function test_duplicate_page(): void {
Línea 49... Línea 49...
49
        global $DB;
49
        global $DB;
50
 
50
 
51
        $this->resetAfterTest();
51
        $this->resetAfterTest();
Línea 81... Línea 81...
81
    }
81
    }
Línea 82... Línea 82...
82
 
82
 
83
    /**
83
    /**
84
     * Test test_lesson_get_user_deadline().
84
     * Test test_lesson_get_user_deadline().
85
     */
85
     */
86
    public function test_lesson_get_user_deadline() {
86
    public function test_lesson_get_user_deadline(): void {
Línea 87... Línea 87...
87
        global $DB;
87
        global $DB;
88
 
88
 
Línea 218... Línea 218...
218
        $comparearray[$lesson2->id] = $object;
218
        $comparearray[$lesson2->id] = $object;
Línea 219... Línea 219...
219
 
219
 
220
        $this->assertEquals($comparearray, lesson_get_user_deadline($course->id));
220
        $this->assertEquals($comparearray, lesson_get_user_deadline($course->id));
Línea 221... Línea 221...
221
    }
221
    }
222
 
222
 
223
    public function test_is_participant() {
223
    public function test_is_participant(): void {
224
        global $USER, $DB;
224
        global $USER, $DB;
225
        $this->resetAfterTest();
225
        $this->resetAfterTest();
226
        $this->setAdminUser();
226
        $this->setAdminUser();
Línea 276... Línea 276...
276
     * @dataProvider get_last_attempt_dataprovider
276
     * @dataProvider get_last_attempt_dataprovider
277
     * @param int $maxattempts Lesson setting.
277
     * @param int $maxattempts Lesson setting.
278
     * @param array $attempts The list of student attempts.
278
     * @param array $attempts The list of student attempts.
279
     * @param object $expected Expected result.
279
     * @param object $expected Expected result.
280
     */
280
     */
281
    public function test_get_last_attempt($maxattempts, $attempts, $expected) {
281
    public function test_get_last_attempt($maxattempts, $attempts, $expected): void {
282
        $this->resetAfterTest();
282
        $this->resetAfterTest();
283
        $this->setAdminUser();
283
        $this->setAdminUser();
284
        $course = $this->getDataGenerator()->create_course();
284
        $course = $this->getDataGenerator()->create_course();
285
        $lesson = $this->getDataGenerator()->create_module('lesson', ['course' => $course, 'maxattempts' => $maxattempts]);
285
        $lesson = $this->getDataGenerator()->create_module('lesson', ['course' => $course, 'maxattempts' => $maxattempts]);
286
        $lesson = new lesson($lesson);
286
        $lesson = new lesson($lesson);