Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 25... Línea 25...
25
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
 * @covers     \mod_lesson_generator
26
 * @covers     \mod_lesson_generator
27
 */
27
 */
28
class generator_test extends \advanced_testcase {
28
class generator_test extends \advanced_testcase {
Línea 29... Línea 29...
29
 
29
 
30
    public function test_create_instance() {
30
    public function test_create_instance(): void {
31
        global $DB;
31
        global $DB;
32
        $this->resetAfterTest();
32
        $this->resetAfterTest();
Línea 33... Línea 33...
33
        $this->setAdminUser();
33
        $this->setAdminUser();
Línea 45... Línea 45...
45
        $records = $DB->get_records('lesson', array('course' => $course->id), 'id');
45
        $records = $DB->get_records('lesson', array('course' => $course->id), 'id');
46
        $this->assertEquals(2, count($records));
46
        $this->assertEquals(2, count($records));
47
        $this->assertEquals('Another lesson', $records[$lesson->id]->name);
47
        $this->assertEquals('Another lesson', $records[$lesson->id]->name);
48
    }
48
    }
Línea 49... Línea 49...
49
 
49
 
50
    public function test_create_content() {
50
    public function test_create_content(): void {
51
        global $DB;
51
        global $DB;
52
        $this->resetAfterTest();
52
        $this->resetAfterTest();
Línea 53... Línea 53...
53
        $this->setAdminUser();
53
        $this->setAdminUser();
Línea 66... Línea 66...
66
    }
66
    }
Línea 67... Línea 67...
67
 
67
 
68
    /**
68
    /**
69
     * This tests the true/false question generator.
69
     * This tests the true/false question generator.
70
     */
70
     */
71
    public function test_create_question_truefalse() {
71
    public function test_create_question_truefalse(): void {
72
        global $DB;
72
        global $DB;
73
        $this->resetAfterTest();
73
        $this->resetAfterTest();
Línea 74... Línea 74...
74
        $this->setAdminUser();
74
        $this->setAdminUser();
Línea 91... Línea 91...
91
    }
91
    }
Línea 92... Línea 92...
92
 
92
 
93
    /**
93
    /**
94
     * This tests the multichoice question generator.
94
     * This tests the multichoice question generator.
95
     */
95
     */
96
    public function test_create_question_multichoice() {
96
    public function test_create_question_multichoice(): void {
97
        global $DB;
97
        global $DB;
98
        $this->resetAfterTest();
98
        $this->resetAfterTest();
Línea 99... Línea 99...
99
        $this->setAdminUser();
99
        $this->setAdminUser();
Línea 116... Línea 116...
116
    }
116
    }
Línea 117... Línea 117...
117
 
117
 
118
    /**
118
    /**
119
     * This tests the essay question generator.
119
     * This tests the essay question generator.
120
     */
120
     */
121
    public function test_create_question_essay() {
121
    public function test_create_question_essay(): void {
122
        global $DB;
122
        global $DB;
123
        $this->resetAfterTest();
123
        $this->resetAfterTest();
Línea 124... Línea 124...
124
        $this->setAdminUser();
124
        $this->setAdminUser();
Línea 141... Línea 141...
141
    }
141
    }
Línea 142... Línea 142...
142
 
142
 
143
    /**
143
    /**
144
     * This tests the matching question generator.
144
     * This tests the matching question generator.
145
     */
145
     */
146
    public function test_create_question_matching() {
146
    public function test_create_question_matching(): void {
147
        global $DB;
147
        global $DB;
148
        $this->resetAfterTest();
148
        $this->resetAfterTest();
Línea 149... Línea 149...
149
        $this->setAdminUser();
149
        $this->setAdminUser();
Línea 166... Línea 166...
166
    }
166
    }
Línea 167... Línea 167...
167
 
167
 
168
    /**
168
    /**
169
     * This tests the numeric question generator.
169
     * This tests the numeric question generator.
170
     */
170
     */
171
    public function test_create_question_numeric() {
171
    public function test_create_question_numeric(): void {
172
        global $DB;
172
        global $DB;
173
        $this->resetAfterTest();
173
        $this->resetAfterTest();
Línea 174... Línea 174...
174
        $this->setAdminUser();
174
        $this->setAdminUser();
Línea 191... Línea 191...
191
    }
191
    }
Línea 192... Línea 192...
192
 
192
 
193
    /**
193
    /**
194
     * This tests the shortanswer question generator.
194
     * This tests the shortanswer question generator.
195
     */
195
     */
196
    public function test_create_question_shortanswer() {
196
    public function test_create_question_shortanswer(): void {
197
        global $DB;
197
        global $DB;
198
        $this->resetAfterTest();
198
        $this->resetAfterTest();
Línea 199... Línea 199...
199
        $this->setAdminUser();
199
        $this->setAdminUser();