Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 34... Línea 34...
34
    /**
34
    /**
35
     * Test for static create_from_plugin method.
35
     * Test for static create_from_plugin method.
36
     *
36
     *
37
     * @covers ::create_from_plugin
37
     * @covers ::create_from_plugin
38
     */
38
     */
39
    public function test_create_from_plugin() {
39
    public function test_create_from_plugin(): void {
40
        $this->resetAfterTest();
40
        $this->resetAfterTest();
41
        $this->setAdminUser();
41
        $this->setAdminUser();
Línea 42... Línea 42...
42
 
42
 
43
        // Check create_from_plugin is working as expected when an existing plugin is given.
43
        // Check create_from_plugin is working as expected when an existing plugin is given.
Línea 60... Línea 60...
60
    /**
60
    /**
61
     * Test for static create_from_storedfile method.
61
     * Test for static create_from_storedfile method.
62
     *
62
     *
63
     * @covers ::create_from_storedfile
63
     * @covers ::create_from_storedfile
64
     */
64
     */
65
    public function test_create_from_storedfile() {
65
    public function test_create_from_storedfile(): void {
66
        global $USER;
66
        global $USER;
Línea 67... Línea 67...
67
 
67
 
68
        $this->resetAfterTest();
68
        $this->resetAfterTest();
Línea 112... Línea 112...
112
    /**
112
    /**
113
     * Test for static create_from_instance method.
113
     * Test for static create_from_instance method.
114
     *
114
     *
115
     * @covers ::create_from_instance
115
     * @covers ::create_from_instance
116
     */
116
     */
117
    public function test_create_from_instance() {
117
    public function test_create_from_instance(): void {
118
        $this->resetAfterTest();
118
        $this->resetAfterTest();
119
        $this->setAdminUser();
119
        $this->setAdminUser();
Línea 120... Línea 120...
120
 
120
 
121
        // Create a course and a database activity.
121
        // Create a course and a database activity.
Línea 159... Línea 159...
159
    /**
159
    /**
160
     * Test for static create_from_fullname method.
160
     * Test for static create_from_fullname method.
161
     *
161
     *
162
     * @covers ::create_from_fullname
162
     * @covers ::create_from_fullname
163
     */
163
     */
164
    public function test_create_from_fullname() {
164
    public function test_create_from_fullname(): void {
165
        $this->resetAfterTest();
165
        $this->resetAfterTest();
166
        $this->setAdminUser();
166
        $this->setAdminUser();
Línea 167... Línea 167...
167
 
167
 
168
        // Create a course and a database activity.
168
        // Create a course and a database activity.
Línea 206... Línea 206...
206
    /**
206
    /**
207
     * Test for the save a preset method when the preset hasn't been saved before.
207
     * Test for the save a preset method when the preset hasn't been saved before.
208
     *
208
     *
209
     * @covers ::save
209
     * @covers ::save
210
     */
210
     */
211
    public function test_save_new_preset() {
211
    public function test_save_new_preset(): void {
212
        $this->resetAfterTest();
212
        $this->resetAfterTest();
213
        $this->setAdminUser();
213
        $this->setAdminUser();
Línea 214... Línea 214...
214
 
214
 
215
        // Save should return false when trying to save a plugin preset.
215
        // Save should return false when trying to save a plugin preset.
Línea 262... Línea 262...
262
    /**
262
    /**
263
     * Test for the save a preset method when is an existing preset that has been saved before.
263
     * Test for the save a preset method when is an existing preset that has been saved before.
264
     *
264
     *
265
     * @covers ::save
265
     * @covers ::save
266
     */
266
     */
267
    public function test_save_existing_preset() {
267
    public function test_save_existing_preset(): void {
268
        $this->resetAfterTest();
268
        $this->resetAfterTest();
269
        $this->setAdminUser();
269
        $this->setAdminUser();
Línea 270... Línea 270...
270
 
270
 
271
        // Create a course and a database activity.
271
        // Create a course and a database activity.
Línea 349... Línea 349...
349
    /**
349
    /**
350
     * Test for the export a preset method.
350
     * Test for the export a preset method.
351
     *
351
     *
352
     * @covers ::export
352
     * @covers ::export
353
     */
353
     */
354
    public function test_export() {
354
    public function test_export(): void {
355
        $this->resetAfterTest();
355
        $this->resetAfterTest();
356
        $this->setAdminUser();
356
        $this->setAdminUser();
Línea 357... Línea 357...
357
 
357
 
358
        // Export should return empty string when trying to export a plugin preset.
358
        // Export should return empty string when trying to export a plugin preset.
Línea 409... Línea 409...
409
    /**
409
    /**
410
     * Test for get_userid().
410
     * Test for get_userid().
411
     *
411
     *
412
     * @covers ::get_userid
412
     * @covers ::get_userid
413
     */
413
     */
414
    public function test_get_userid() {
414
    public function test_get_userid(): void {
415
        $this->resetAfterTest();
415
        $this->resetAfterTest();
Línea 416... Línea 416...
416
 
416
 
417
        $course = $this->getDataGenerator()->create_course();
417
        $course = $this->getDataGenerator()->create_course();
418
        $activity = $this->getDataGenerator()->create_module(manager::MODULE, ['course' => $course]);
418
        $activity = $this->getDataGenerator()->create_module(manager::MODULE, ['course' => $course]);
Línea 443... Línea 443...
443
    /**
443
    /**
444
     * Test for get_path().
444
     * Test for get_path().
445
     *
445
     *
446
     * @covers ::get_path
446
     * @covers ::get_path
447
     */
447
     */
448
    public function test_get_path() {
448
    public function test_get_path(): void {
449
        $this->resetAfterTest();
449
        $this->resetAfterTest();
450
        $this->setAdminUser();
450
        $this->setAdminUser();
Línea 451... Línea 451...
451
 
451
 
452
        $course = $this->getDataGenerator()->create_course();
452
        $course = $this->getDataGenerator()->create_course();
Línea 517... Línea 517...
517
    /**
517
    /**
518
     * Test for get_name_from_plugin().
518
     * Test for get_name_from_plugin().
519
     *
519
     *
520
     * @covers ::get_name_from_plugin
520
     * @covers ::get_name_from_plugin
521
     */
521
     */
522
    public function test_get_name_from_plugin() {
522
    public function test_get_name_from_plugin(): void {
523
        $this->resetAfterTest();
523
        $this->resetAfterTest();
524
        $this->setAdminUser();
524
        $this->setAdminUser();
Línea 525... Línea 525...
525
 
525
 
526
        // The expected name for plugins with modulename in lang is this value.
526
        // The expected name for plugins with modulename in lang is this value.
Línea 536... Línea 536...
536
    /**
536
    /**
537
     * Test for get_description_from_plugin().
537
     * Test for get_description_from_plugin().
538
     *
538
     *
539
     * @covers ::get_description_from_plugin
539
     * @covers ::get_description_from_plugin
540
     */
540
     */
541
    public function test_get_description_from_plugin() {
541
    public function test_get_description_from_plugin(): void {
542
        $this->resetAfterTest();
542
        $this->resetAfterTest();
543
        $this->setAdminUser();
543
        $this->setAdminUser();
Línea 544... Línea 544...
544
 
544
 
545
        // The expected name for plugins with modulename in lang is this value.
545
        // The expected name for plugins with modulename in lang is this value.
Línea 558... Línea 558...
558
     * @covers ::generate_preset_xml
558
     * @covers ::generate_preset_xml
559
     * @dataProvider generate_preset_xml_provider
559
     * @dataProvider generate_preset_xml_provider
560
     * @param array $params activity config settings
560
     * @param array $params activity config settings
561
     * @param string|null $description preset description
561
     * @param string|null $description preset description
562
     */
562
     */
563
    public function test_generate_preset_xml(array $params, ?string $description) {
563
    public function test_generate_preset_xml(array $params, ?string $description): void {
564
        $this->resetAfterTest();
564
        $this->resetAfterTest();
565
        $this->setAdminUser();
565
        $this->setAdminUser();
Línea 566... Línea 566...
566
 
566
 
567
        // Make accessible the method.
567
        // Make accessible the method.
Línea 637... Línea 637...
637
    /**
637
    /**
638
     * Test for get_file().
638
     * Test for get_file().
639
     *
639
     *
640
     * @covers ::get_file
640
     * @covers ::get_file
641
     */
641
     */
642
    public function test_get_file() {
642
    public function test_get_file(): void {
643
        $this->resetAfterTest();
643
        $this->resetAfterTest();
644
        $this->setAdminUser();
644
        $this->setAdminUser();
Línea 645... Línea 645...
645
 
645
 
646
        // Create a course and a database activity.
646
        // Create a course and a database activity.
Línea 669... Línea 669...
669
    /**
669
    /**
670
     * Test for can_manage().
670
     * Test for can_manage().
671
     *
671
     *
672
     * @covers ::can_manage
672
     * @covers ::can_manage
673
     */
673
     */
674
    public function test_can_manage() {
674
    public function test_can_manage(): void {
675
        $this->resetAfterTest();
675
        $this->resetAfterTest();
Línea 676... Línea 676...
676
 
676
 
677
        // Create course, database activity and users.
677
        // Create course, database activity and users.
678
        $course = $this->getDataGenerator()->create_course();
678
        $course = $this->getDataGenerator()->create_course();
Línea 725... Línea 725...
725
    /**
725
    /**
726
     * Test for delete().
726
     * Test for delete().
727
     *
727
     *
728
     * @covers ::delete
728
     * @covers ::delete
729
     */
729
     */
730
    public function test_delete() {
730
    public function test_delete(): void {
731
        $this->resetAfterTest();
731
        $this->resetAfterTest();
Línea 732... Línea 732...
732
 
732
 
733
        // Create course, database activity and users.
733
        // Create course, database activity and users.
734
        $course = $this->getDataGenerator()->create_course();
734
        $course = $this->getDataGenerator()->create_course();
Línea 785... Línea 785...
785
    /**
785
    /**
786
     * Test for the get_fields method.
786
     * Test for the get_fields method.
787
     *
787
     *
788
     * @covers ::get_fields
788
     * @covers ::get_fields
789
     */
789
     */
790
    public function test_get_fields() {
790
    public function test_get_fields(): void {
791
        $this->resetAfterTest();
791
        $this->resetAfterTest();
792
        $this->setAdminUser();
792
        $this->setAdminUser();
Línea 793... Línea 793...
793
 
793
 
794
        // Create a course and a database activity.
794
        // Create a course and a database activity.
Línea 835... Línea 835...
835
    /**
835
    /**
836
     * Test for the get_sample_entries method.
836
     * Test for the get_sample_entries method.
837
     *
837
     *
838
     * @covers ::get_sample_entries
838
     * @covers ::get_sample_entries
839
     */
839
     */
840
    public function test_get_sample_entries() {
840
    public function test_get_sample_entries(): void {
841
        $this->resetAfterTest();
841
        $this->resetAfterTest();
Línea 842... Línea 842...
842
 
842
 
843
        $user = $this->getDataGenerator()->create_user();
843
        $user = $this->getDataGenerator()->create_user();
Línea 879... Línea 879...
879
    /**
879
    /**
880
     * Test for the get_template_content method.
880
     * Test for the get_template_content method.
881
     *
881
     *
882
     * @covers ::get_template_content
882
     * @covers ::get_template_content
883
     */
883
     */
884
    public function test_get_template_content() {
884
    public function test_get_template_content(): void {
885
        $this->resetAfterTest();
885
        $this->resetAfterTest();
Línea 886... Línea 886...
886
 
886
 
887
        $user = $this->getDataGenerator()->create_user();
887
        $user = $this->getDataGenerator()->create_user();
888
        $this->setUser($user);
888
        $this->setUser($user);
Línea 936... Línea 936...
936
    /**
936
    /**
937
     * Test for the get_fullname method.
937
     * Test for the get_fullname method.
938
     *
938
     *
939
     * @covers ::get_fullname
939
     * @covers ::get_fullname
940
     */
940
     */
941
    public function test_get_fullname() {
941
    public function test_get_fullname(): void {
942
        $this->resetAfterTest();
942
        $this->resetAfterTest();
Línea 943... Línea 943...
943
 
943
 
944
        $user = $this->getDataGenerator()->create_user();
944
        $user = $this->getDataGenerator()->create_user();
945
        $this->setUser($user);
945
        $this->setUser($user);