Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 37... Línea 37...
37
     * Set up testcase.
37
     * Set up testcase.
38
     */
38
     */
39
    public function setUp(): void {
39
    public function setUp(): void {
40
        global $CFG;
40
        global $CFG;
Línea -... Línea 41...
-
 
41
 
-
 
42
        parent::setUp();
41
 
43
 
42
        $CFG->enablecompletion = true;
44
        $CFG->enablecompletion = true;
43
        $this->setAdminUser();
45
        $this->setAdminUser();
44
        $this->resetAfterTest();
46
        $this->resetAfterTest();
45
        $this->generator = $this->getDataGenerator();
47
        $this->generator = $this->getDataGenerator();
Línea 46... Línea 48...
46
    }
48
    }
47
 
49
 
48
    /**
50
    /**
49
     * Test process_activities_by_filter_options function.
51
     * Test process_activities_by_filter_options function.
50
     */
52
     */
Línea 51... Línea 53...
51
    public function test_sort_activities() {
53
    public function test_sort_activities(): void {
52
        $expectedactivitytypes = ['all' => 'All activities and resources', 'assign' => 'Assignments', 'quiz' => 'Quizzes'];
54
        $expectedactivitytypes = ['all' => 'All activities and resources', 'assign' => 'Assignments', 'quiz' => 'Quizzes'];
53
 
55
 
Línea 72... Línea 74...
72
    }
74
    }
Línea 73... Línea 75...
73
 
75
 
74
    /**
76
    /**
75
     * Test filtering by section.
77
     * Test filtering by section.
76
     */
78
     */
77
    public function test_filter_activities_by_section() {
79
    public function test_filter_activities_by_section(): void {
78
        $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));
80
        $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));
79
        $this->generator->create_module('quiz', ['course' => $course->id, 'name' => 'Quiz 2', 'section' => 1],
81
        $this->generator->create_module('quiz', ['course' => $course->id, 'name' => 'Quiz 2', 'section' => 1],
80
                ['completion' => 1]);
82
                ['completion' => 1]);
81
        $this->generator->create_module('quiz', ['course' => $course->id, 'name' => 'Quiz 1', 'section' => 2],
83
        $this->generator->create_module('quiz', ['course' => $course->id, 'name' => 'Quiz 1', 'section' => 2],