Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 143... Línea 143...
143
    }
143
    }
Línea 144... Línea 144...
144
 
144
 
145
    /**
145
    /**
146
     * Simple check for importing a category with a description.
146
     * Simple check for importing a category with a description.
147
     */
147
     */
148
    public function test_import_category() {
148
    public function test_import_category(): void {
149
        $this->resetAfterTest();
149
        $this->resetAfterTest();
150
        $course = $this->getDataGenerator()->create_course();
150
        $course = $this->getDataGenerator()->create_course();
151
        $this->setAdminUser();
151
        $this->setAdminUser();
152
        $qformat = $this->create_qformat('category_with_description.xml', $course);
152
        $qformat = $this->create_qformat('category_with_description.xml', $course);
Línea 158... Línea 158...
158
    }
158
    }
Línea 159... Línea 159...
159
 
159
 
160
    /**
160
    /**
161
     * Check importing nested categories.
161
     * Check importing nested categories.
162
     */
162
     */
163
    public function test_import_nested_categories() {
163
    public function test_import_nested_categories(): void {
164
        $this->resetAfterTest();
164
        $this->resetAfterTest();
165
        $course = $this->getDataGenerator()->create_course();
165
        $course = $this->getDataGenerator()->create_course();
166
        $this->setAdminUser();
166
        $this->setAdminUser();
167
        $qformat = $this->create_qformat('nested_categories.xml', $course);
167
        $qformat = $this->create_qformat('nested_categories.xml', $course);
Línea 176... Línea 176...
176
    }
176
    }
Línea 177... Línea 177...
177
 
177
 
178
    /**
178
    /**
179
     * Check importing nested categories contain the right questions.
179
     * Check importing nested categories contain the right questions.
180
     */
180
     */
181
    public function test_import_nested_categories_with_questions() {
181
    public function test_import_nested_categories_with_questions(): void {
182
        $this->resetAfterTest();
182
        $this->resetAfterTest();
183
        $course = $this->getDataGenerator()->create_course();
183
        $course = $this->getDataGenerator()->create_course();
184
        $this->setAdminUser();
184
        $this->setAdminUser();
185
        $qformat = $this->create_qformat('nested_categories_with_questions.xml', $course);
185
        $qformat = $this->create_qformat('nested_categories_with_questions.xml', $course);
Línea 200... Línea 200...
200
    }
200
    }
Línea 201... Línea 201...
201
 
201
 
202
    /**
202
    /**
203
     * Check import of an old file (without format), for backward compatability.
203
     * Check import of an old file (without format), for backward compatability.
204
     */
204
     */
205
    public function test_import_old_format() {
205
    public function test_import_old_format(): void {
206
        $this->resetAfterTest();
206
        $this->resetAfterTest();
207
        $course = $this->getDataGenerator()->create_course();
207
        $course = $this->getDataGenerator()->create_course();
208
        $this->setAdminUser();
208
        $this->setAdminUser();
209
        $qformat = $this->create_qformat('old_format_file.xml', $course);
209
        $qformat = $this->create_qformat('old_format_file.xml', $course);
Línea 218... Línea 218...
218
    }
218
    }
Línea 219... Línea 219...
219
 
219
 
220
    /**
220
    /**
221
     * Check the import of an xml file where the child category exists before the parent category.
221
     * Check the import of an xml file where the child category exists before the parent category.
222
     */
222
     */
223
    public function test_import_categories_in_reverse_order() {
223
    public function test_import_categories_in_reverse_order(): void {
224
        $this->resetAfterTest();
224
        $this->resetAfterTest();
225
        $course = $this->getDataGenerator()->create_course();
225
        $course = $this->getDataGenerator()->create_course();
226
        $this->setAdminUser();
226
        $this->setAdminUser();
227
        $qformat = $this->create_qformat('categories_reverse_order.xml', $course);
227
        $qformat = $this->create_qformat('categories_reverse_order.xml', $course);
Línea 261... Línea 261...
261
    }
261
    }
Línea 262... Línea 262...
262
 
262
 
263
    /**
263
    /**
264
     * Simple check for exporting a category.
264
     * Simple check for exporting a category.
265
     */
265
     */
266
    public function test_export_category() {
266
    public function test_export_category(): void {
Línea 267... Línea 267...
267
        global $SITE;
267
        global $SITE;
268
 
268
 
269
        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
269
        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
Línea 299... Línea 299...
299
    }
299
    }
Línea 300... Línea 300...
300
 
300
 
301
    /**
301
    /**
302
     * Check exporting nested categories.
302
     * Check exporting nested categories.
303
     */
303
     */
304
    public function test_export_nested_categories() {
304
    public function test_export_nested_categories(): void {
Línea 305... Línea 305...
305
        global $SITE;
305
        global $SITE;
306
 
306
 
307
        $this->resetAfterTest();
307
        $this->resetAfterTest();
Línea 353... Línea 353...
353
    }
353
    }
Línea 354... Línea 354...
354
 
354
 
355
    /**
355
    /**
356
     * Check exporting nested categories contain the right questions.
356
     * Check exporting nested categories contain the right questions.
357
     */
357
     */
358
    public function test_export_nested_categories_with_questions() {
358
    public function test_export_nested_categories_with_questions(): void {
Línea 359... Línea 359...
359
        global $SITE;
359
        global $SITE;
360
 
360
 
361
        $this->resetAfterTest();
361
        $this->resetAfterTest();
Línea 460... Línea 460...
460
    }
460
    }
Línea 461... Línea 461...
461
 
461
 
462
    /**
462
    /**
463
     * Simple check for exporting a category.
463
     * Simple check for exporting a category.
464
     */
464
     */
465
    public function test_export_category_with_special_chars() {
465
    public function test_export_category_with_special_chars(): void {
Línea 466... Línea 466...
466
        global $SITE;
466
        global $SITE;
467
 
467
 
468
        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
468
        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
Línea 499... Línea 499...
499
    }
499
    }
Línea 500... Línea 500...
500
 
500
 
501
    /**
501
    /**
502
     * Test that bad multianswer questions are not imported.
502
     * Test that bad multianswer questions are not imported.
503
     */
503
     */
504
    public function test_import_broken_multianswer_questions() {
504
    public function test_import_broken_multianswer_questions(): void {
505
        $lines = file(__DIR__ . '/fixtures/broken_cloze_questions.xml');
505
        $lines = file(__DIR__ . '/fixtures/broken_cloze_questions.xml');
Línea 506... Línea 506...
506
        $importer = $qformat = new qformat_xml();
506
        $importer = $qformat = new qformat_xml();
507
 
507