Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 35... Línea 35...
35
    }
35
    }
Línea 36... Línea 36...
36
 
36
 
37
    /**
37
    /**
38
     * Test that a http link is generated correctly.
38
     * Test that a http link is generated correctly.
39
     */
39
     */
40
    public function test_http_link_generated() {
40
    public function test_http_link_generated(): void {
41
        $course = $this->getDataGenerator()->create_course();
41
        $course = $this->getDataGenerator()->create_course();
Línea 42... Línea 42...
42
        $quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $course->id]);
42
        $quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $course->id]);
43
 
43
 
Línea 47... Línea 47...
47
    }
47
    }
Línea 48... Línea 48...
48
 
48
 
49
    /**
49
    /**
50
     * Test that a http link is generated correctly.
50
     * Test that a http link is generated correctly.
51
     */
51
     */
52
    public function test_https_link_generated() {
52
    public function test_https_link_generated(): void {
53
        $course = $this->getDataGenerator()->create_course();
53
        $course = $this->getDataGenerator()->create_course();
Línea 54... Línea 54...
54
        $quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $course->id]);
54
        $quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $course->id]);
55
 
55
 
Línea 59... Línea 59...
59
    }
59
    }
Línea 60... Línea 60...
60
 
60
 
61
    /**
61
    /**
62
     * Test that a seb link is generated correctly.
62
     * Test that a seb link is generated correctly.
63
     */
63
     */
64
    public function test_seb_link_generated() {
64
    public function test_seb_link_generated(): void {
65
        $course = $this->getDataGenerator()->create_course();
65
        $course = $this->getDataGenerator()->create_course();
Línea 66... Línea 66...
66
        $quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $course->id]);
66
        $quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $course->id]);
67
 
67
 
Línea 71... Línea 71...
71
    }
71
    }
Línea 72... Línea 72...
72
 
72
 
73
    /**
73
    /**
74
     * Test that a sebs link is generated correctly.
74
     * Test that a sebs link is generated correctly.
75
     */
75
     */
76
    public function test_sebs_link_generated() {
76
    public function test_sebs_link_generated(): void {
77
        $course = $this->getDataGenerator()->create_course();
77
        $course = $this->getDataGenerator()->create_course();
Línea 78... Línea 78...
78
        $quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $course->id]);
78
        $quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $course->id]);
79
 
79
 
Línea 83... Línea 83...
83
    }
83
    }
Línea 84... Línea 84...
84
 
84
 
85
    /**
85
    /**
86
     * Test that link_generator can't not be instantiated with fake course module.
86
     * Test that link_generator can't not be instantiated with fake course module.
87
     */
87
     */
88
    public function test_course_module_does_not_exist() {
88
    public function test_course_module_does_not_exist(): void {
89
        $this->expectException(\dml_exception::class);
89
        $this->expectException(\dml_exception::class);
90
        $this->expectExceptionMessageMatches("/^Can't find data record in database.*/");
90
        $this->expectExceptionMessageMatches("/^Can't find data record in database.*/");
91
        $generator = link_generator::get_link(123456, false);
91
        $generator = link_generator::get_link(123456, false);
92
    }
92
    }