Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 39... Línea 39...
39
class tests_content_writer_test extends advanced_testcase {
39
class tests_content_writer_test extends advanced_testcase {
Línea 40... Línea 40...
40
 
40
 
41
    /**
41
    /**
42
     * It should be possible to store and retrieve data.
42
     * It should be possible to store and retrieve data.
43
     */
43
     */
44
    public function test_export_data() {
44
    public function test_export_data(): void {
45
        $context = \context_system::instance();
45
        $context = \context_system::instance();
Línea 46... Línea 46...
46
        $writer = $this->get_writer_instance();
46
        $writer = $this->get_writer_instance();
47
 
47
 
Línea 64... Línea 64...
64
    }
64
    }
Línea 65... Línea 65...
65
 
65
 
66
    /**
66
    /**
67
     * It should be possible to store and retrieve data at the same point in different contexts.
67
     * It should be possible to store and retrieve data at the same point in different contexts.
68
     */
68
     */
69
    public function test_export_data_no_context_clash() {
69
    public function test_export_data_no_context_clash(): void {
Línea 70... Línea 70...
70
        $writer = $this->get_writer_instance();
70
        $writer = $this->get_writer_instance();
71
 
71
 
72
        $context = \context_system::instance();
72
        $context = \context_system::instance();
Línea 97... Línea 97...
97
    }
97
    }
Línea 98... Línea 98...
98
 
98
 
99
    /**
99
    /**
100
     * Test export and recover with children.
100
     * Test export and recover with children.
101
     */
101
     */
102
    public function test_get_data_with_children() {
102
    public function test_get_data_with_children(): void {
103
        $writer = $this->get_writer_instance();
103
        $writer = $this->get_writer_instance();
Línea 104... Línea 104...
104
        $context = \context_system::instance();
104
        $context = \context_system::instance();
105
 
105
 
Línea 113... Línea 113...
113
    }
113
    }
Línea 114... Línea 114...
114
 
114
 
115
    /**
115
    /**
116
     * It should be possible to store and retrieve metadata.
116
     * It should be possible to store and retrieve metadata.
117
     */
117
     */
118
    public function test_export_metadata() {
118
    public function test_export_metadata(): void {
119
        $context = \context_system::instance();
119
        $context = \context_system::instance();
Línea 120... Línea 120...
120
        $writer = $this->get_writer_instance();
120
        $writer = $this->get_writer_instance();
121
 
121
 
Línea 147... Línea 147...
147
    }
147
    }
Línea 148... Línea 148...
148
 
148
 
149
    /**
149
    /**
150
     * It should be possible to store and retrieve metadata at the same point in different contexts.
150
     * It should be possible to store and retrieve metadata at the same point in different contexts.
151
     */
151
     */
152
    public function test_export_metadata_no_context_clash() {
152
    public function test_export_metadata_no_context_clash(): void {
Línea 153... Línea 153...
153
        $writer = $this->get_writer_instance();
153
        $writer = $this->get_writer_instance();
154
 
154
 
155
        $context = \context_system::instance();
155
        $context = \context_system::instance();
Línea 190... Línea 190...
190
    }
190
    }
Línea 191... Línea 191...
191
 
191
 
192
    /**
192
    /**
193
     * It should be possible to store and retrieve user preferences.
193
     * It should be possible to store and retrieve user preferences.
194
     */
194
     */
195
    public function test_export_user_preference() {
195
    public function test_export_user_preference(): void {
196
        $context = \context_system::instance();
196
        $context = \context_system::instance();
197
        $adminuser = \core_user::get_user_by_username('admin');
197
        $adminuser = \core_user::get_user_by_username('admin');
198
        $usercontext = \context_user::instance($adminuser->id);
198
        $usercontext = \context_user::instance($adminuser->id);
Línea 230... Línea 230...
230
    }
230
    }
Línea 231... Línea 231...
231
 
231
 
232
    /**
232
    /**
233
     * It should be possible to store and retrieve user preferences at the same point in different contexts.
233
     * It should be possible to store and retrieve user preferences at the same point in different contexts.
234
     */
234
     */
235
    public function test_export_user_preference_no_context_clash() {
235
    public function test_export_user_preference_no_context_clash(): void {
236
        $writer = $this->get_writer_instance();
236
        $writer = $this->get_writer_instance();
237
        $context = \context_system::instance();
237
        $context = \context_system::instance();
238
        $coursecontext = \context_course::instance(SITEID);
238
        $coursecontext = \context_course::instance(SITEID);
239
        $adminuser = \core_user::get_user_by_username('admin');
239
        $adminuser = \core_user::get_user_by_username('admin');
Línea 270... Línea 270...
270
    }
270
    }
Línea 271... Línea 271...
271
 
271
 
272
    /**
272
    /**
273
     * Test export and recover with children.
273
     * Test export and recover with children.
274
     */
274
     */
275
    public function test_get_metadata_with_children() {
275
    public function test_get_metadata_with_children(): void {
276
        $writer = $this->get_writer_instance();
276
        $writer = $this->get_writer_instance();
Línea 277... Línea 277...
277
        $context = \context_system::instance();
277
        $context = \context_system::instance();
278
 
278
 
Línea 285... Línea 285...
285
    }
285
    }
Línea 286... Línea 286...
286
 
286
 
287
    /**
287
    /**
288
     * It should be possible to export files in the files and children contexts.
288
     * It should be possible to export files in the files and children contexts.
289
     */
289
     */
290
    public function test_export_file_special_folders() {
290
    public function test_export_file_special_folders(): void {
Línea 291... Línea 291...
291
        $context = \context_system::instance();
291
        $context = \context_system::instance();
292
 
292
 
Línea 307... Línea 307...
307
 
307
 
308
    /**
308
    /**
309
     * It should be possible to export mutliple files in the same subcontext/path space but different context and not
309
     * It should be possible to export mutliple files in the same subcontext/path space but different context and not
310
     * have them clash.
310
     * have them clash.
311
     */
311
     */
312
    public function test_export_file_no_context_clash() {
312
    public function test_export_file_no_context_clash(): void {
313
        $writer = $this->get_writer_instance();
313
        $writer = $this->get_writer_instance();
314
        $context = \context_system::instance();
314
        $context = \context_system::instance();
315
        $filea = $this->get_stored_file('/foo/', 'foo.txt');
315
        $filea = $this->get_stored_file('/foo/', 'foo.txt');
316
        $writer = $this->get_writer_instance()
316
        $writer = $this->get_writer_instance()
Línea 337... Línea 337...
337
    }
337
    }
Línea 338... Línea 338...
338
 
338
 
339
    /**
339
    /**
340
     * Test export and recover with children.
340
     * Test export and recover with children.
341
     */
341
     */
342
    public function test_get_file_with_children() {
342
    public function test_get_file_with_children(): void {
343
        $writer = $this->get_writer_instance();
343
        $writer = $this->get_writer_instance();
Línea 344... Línea 344...
344
        $context = \context_system::instance();
344
        $context = \context_system::instance();
345
 
345
 
Línea 360... Línea 360...
360
    }
360
    }
Línea 361... Línea 361...
361
 
361
 
362
    /**
362
    /**
363
     * It should be possible to export related data in the files and children contexts.
363
     * It should be possible to export related data in the files and children contexts.
364
     */
364
     */
365
    public function test_export_related_data() {
365
    public function test_export_related_data(): void {
Línea 366... Línea 366...
366
        $context = \context_system::instance();
366
        $context = \context_system::instance();
367
 
367
 
368
        $writer = $this->get_writer_instance()
368
        $writer = $this->get_writer_instance()
Línea 390... Línea 390...
390
    }
390
    }
Línea 391... Línea 391...
391
 
391
 
392
    /**
392
    /**
393
     * It should be possible to export related data in the same location,but in a different context.
393
     * It should be possible to export related data in the same location,but in a different context.
394
     */
394
     */
395
    public function test_export_related_data_no_context_clash() {
395
    public function test_export_related_data_no_context_clash(): void {
Línea 396... Línea 396...
396
        $writer = $this->get_writer_instance();
396
        $writer = $this->get_writer_instance();
397
 
397
 
398
        $context = \context_system::instance();
398
        $context = \context_system::instance();
Línea 416... Línea 416...
416
    }
416
    }
Línea 417... Línea 417...
417
 
417
 
418
    /**
418
    /**
419
     * Test export and recover with children.
419
     * Test export and recover with children.
420
     */
420
     */
421
    public function test_get_related_data_with_children() {
421
    public function test_get_related_data_with_children(): void {
422
        $writer = $this->get_writer_instance();
422
        $writer = $this->get_writer_instance();
Línea 423... Línea 423...
423
        $context = \context_system::instance();
423
        $context = \context_system::instance();
424
 
424
 
Línea 431... Línea 431...
431
    }
431
    }
Línea 432... Línea 432...
432
 
432
 
433
    /**
433
    /**
434
     * It should be possible to export related files in the files and children contexts.
434
     * It should be possible to export related files in the files and children contexts.
435
     */
435
     */
436
    public function test_export_custom_file() {
436
    public function test_export_custom_file(): void {
Línea 437... Línea 437...
437
        $context = \context_system::instance();
437
        $context = \context_system::instance();
438
 
438
 
439
        $writer = $this->get_writer_instance()
439
        $writer = $this->get_writer_instance()
Línea 459... Línea 459...
459
 
459
 
460
    /**
460
    /**
461
     * It should be possible to export related files in the same location
461
     * It should be possible to export related files in the same location
462
     * in different contexts.
462
     * in different contexts.
463
     */
463
     */
464
    public function test_export_custom_file_no_context_clash() {
464
    public function test_export_custom_file_no_context_clash(): void {
465
        $writer = $this->get_writer_instance();
465
        $writer = $this->get_writer_instance();
Línea 466... Línea 466...
466
        $context = \context_system::instance();
466
        $context = \context_system::instance();
467
 
467
 
Línea 485... Línea 485...
485
    }
485
    }
Línea 486... Línea 486...
486
 
486
 
487
    /**
487
    /**
488
     * Test export and recover with children.
488
     * Test export and recover with children.
489
     */
489
     */
490
    public function test_get_custom_file_with_children() {
490
    public function test_get_custom_file_with_children(): void {
491
        $writer = $this->get_writer_instance();
491
        $writer = $this->get_writer_instance();
Línea 492... Línea 492...
492
        $context = \context_system::instance();
492
        $context = \context_system::instance();
493
 
493