Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 50... Línea 50...
50
    }
50
    }
Línea 51... Línea 51...
51
 
51
 
52
    /**
52
    /**
53
     * With an empty IMS enterprise file
53
     * With an empty IMS enterprise file
54
     */
54
     */
55
    public function test_emptyfile() {
55
    public function test_emptyfile(): void {
Línea 56... Línea 56...
56
        global $DB;
56
        global $DB;
57
 
57
 
Línea 66... Línea 66...
66
    }
66
    }
Línea 67... Línea 67...
67
 
67
 
68
    /**
68
    /**
69
     * Existing users are not created again
69
     * Existing users are not created again
70
     */
70
     */
71
    public function test_users_existing() {
71
    public function test_users_existing(): void {
Línea 72... Línea 72...
72
        global $DB;
72
        global $DB;
73
 
73
 
Línea 84... Línea 84...
84
    }
84
    }
Línea 85... Línea 85...
85
 
85
 
86
    /**
86
    /**
87
     * Add new users
87
     * Add new users
88
     */
88
     */
89
    public function test_users_add() {
89
    public function test_users_add(): void {
Línea 90... Línea 90...
90
        global $DB;
90
        global $DB;
Línea 91... Línea 91...
91
 
91
 
Línea 106... Línea 106...
106
    }
106
    }
Línea 107... Línea 107...
107
 
107
 
108
    /**
108
    /**
109
     * Add new users and set an auth type
109
     * Add new users and set an auth type
110
     */
110
     */
111
    public function test_users_add_with_auth() {
111
    public function test_users_add_with_auth(): void {
Línea 112... Línea 112...
112
        global $DB;
112
        global $DB;
Línea 113... Línea 113...
113
 
113
 
Línea 136... Línea 136...
136
 
136
 
137
 
137
 
138
    /**
138
    /**
139
     * Update user
139
     * Update user
140
     */
140
     */
Línea 141... Línea 141...
141
    public function test_user_update() {
141
    public function test_user_update(): void {
142
        global $DB;
142
        global $DB;
143
 
143
 
Línea 157... Línea 157...
157
        $this->assertEquals($imsuser->email, $dbuser->email);
157
        $this->assertEquals($imsuser->email, $dbuser->email);
158
        $this->assertEquals($imsuser->firstname, $dbuser->firstname);
158
        $this->assertEquals($imsuser->firstname, $dbuser->firstname);
159
        $this->assertEquals($imsuser->lastname, $dbuser->lastname);
159
        $this->assertEquals($imsuser->lastname, $dbuser->lastname);
160
    }
160
    }
Línea 161... Línea 161...
161
 
161
 
162
    public function test_user_update_disabled() {
162
    public function test_user_update_disabled(): void {
Línea 163... Línea 163...
163
        global $DB;
163
        global $DB;
Línea 164... Línea 164...
164
 
164
 
Línea 185... Línea 185...
185
    }
185
    }
Línea 186... Línea 186...
186
 
186
 
187
    /**
187
    /**
188
     * Delete user
188
     * Delete user
189
     */
189
     */
190
    public function test_user_delete() {
190
    public function test_user_delete(): void {
Línea 191... Línea 191...
191
        global $DB;
191
        global $DB;
192
 
192
 
Línea 206... Línea 206...
206
    }
206
    }
Línea 207... Línea 207...
207
 
207
 
208
    /**
208
    /**
209
     * Delete user disabled
209
     * Delete user disabled
210
     */
210
     */
211
    public function test_user_delete_disabled() {
211
    public function test_user_delete_disabled(): void {
Línea 212... Línea 212...
212
        global $DB;
212
        global $DB;
213
 
213
 
Línea 227... Línea 227...
227
    }
227
    }
Línea 228... Línea 228...
228
 
228
 
229
    /**
229
    /**
230
     * Existing courses are not created again
230
     * Existing courses are not created again
231
     */
231
     */
232
    public function test_courses_existing() {
232
    public function test_courses_existing(): void {
Línea 233... Línea 233...
233
        global $DB;
233
        global $DB;
234
 
234
 
Línea 251... Línea 251...
251
    }
251
    }
Línea 252... Línea 252...
252
 
252
 
253
    /**
253
    /**
254
     * Add new courses
254
     * Add new courses
255
     */
255
     */
256
    public function test_courses_add() {
256
    public function test_courses_add(): void {
Línea 257... Línea 257...
257
        global $DB;
257
        global $DB;
Línea 258... Línea 258...
258
 
258
 
Línea 281... Línea 281...
281
 
281
 
282
    /**
282
    /**
283
     * Verify that courses are not created when createnewcourses
283
     * Verify that courses are not created when createnewcourses
284
     * option is diabled.
284
     * option is diabled.
285
     */
285
     */
286
    public function test_courses_add_createnewcourses_disabled() {
286
    public function test_courses_add_createnewcourses_disabled(): void {
Línea 287... Línea 287...
287
        global $DB;
287
        global $DB;
288
 
288
 
Línea 316... Línea 316...
316
    }
316
    }
Línea 317... Línea 317...
317
 
317
 
318
    /**
318
    /**
319
     * Test adding a course with no idnumber.
319
     * Test adding a course with no idnumber.
320
     */
320
     */
321
    public function test_courses_no_idnumber() {
321
    public function test_courses_no_idnumber(): void {
Línea 322... Línea 322...
322
        global $DB;
322
        global $DB;
Línea 323... Línea 323...
323
 
323
 
Línea 337... Línea 337...
337
    }
337
    }
Línea 338... Línea 338...
338
 
338
 
339
    /**
339
    /**
340
     * Add new course with the truncateidnumber setting.
340
     * Add new course with the truncateidnumber setting.
341
     */
341
     */
342
    public function test_courses_add_truncate_idnumber() {
342
    public function test_courses_add_truncate_idnumber(): void {
Línea 343... Línea 343...
343
        global $DB;
343
        global $DB;
Línea 344... Línea 344...
344
 
344
 
Línea 365... Línea 365...
365
    }
365
    }
Línea 366... Línea 366...
366
 
366
 
367
    /**
367
    /**
368
     * Add new course without a category.
368
     * Add new course without a category.
369
     */
369
     */
370
    public function test_course_add_default_category() {
370
    public function test_course_add_default_category(): void {
Línea 371... Línea 371...
371
        global $DB;
371
        global $DB;
Línea 372... Línea 372...
372
 
372
 
Línea 391... Línea 391...
391
    }
391
    }
Línea 392... Línea 392...
392
 
392
 
393
    /**
393
    /**
394
     * Course attributes mapping to IMS enterprise group description tags
394
     * Course attributes mapping to IMS enterprise group description tags
395
     */
395
     */
396
    public function test_courses_attrmapping() {
396
    public function test_courses_attrmapping(): void {
Línea 397... Línea 397...
397
        global $DB;
397
        global $DB;
398
 
398
 
399
        // Setting a all = coursecode (idnumber) mapping.
399
        // Setting a all = coursecode (idnumber) mapping.
Línea 463... Línea 463...
463
    }
463
    }
Línea 464... Línea 464...
464
 
464
 
465
    /**
465
    /**
466
     * Course updates
466
     * Course updates
467
     */
467
     */
468
    public function test_course_update() {
468
    public function test_course_update(): void {
Línea 469... Línea 469...
469
        global $DB;
469
        global $DB;
470
 
470
 
471
        $course4 = new \stdClass();
471
        $course4 = new \stdClass();
Línea 495... Línea 495...
495
    }
495
    }
Línea 496... Línea 496...
496
 
496
 
497
    /**
497
    /**
498
     * Course delete. Make it hidden.
498
     * Course delete. Make it hidden.
499
     */
499
     */
500
    public function test_course_delete() {
500
    public function test_course_delete(): void {
Línea 501... Línea 501...
501
        global $DB;
501
        global $DB;
502
 
502
 
503
        $course8 = new \stdClass();
503
        $course8 = new \stdClass();
Línea 526... Línea 526...
526
 
526
 
527
 
527
 
528
    /**
528
    /**
529
     * Nested categories with name during course creation
529
     * Nested categories with name during course creation
530
     */
530
     */
Línea 531... Línea 531...
531
    public function test_nested_categories() {
531
    public function test_nested_categories(): void {
Línea 532... Línea 532...
532
        global $DB;
532
        global $DB;
Línea 580... Línea 580...
580
 
580
 
581
 
581
 
582
    /**
582
    /**
583
     * Test that duplicate nested categories with name are not created
583
     * Test that duplicate nested categories with name are not created
584
     */
584
     */
Línea 585... Línea 585...
585
    public function test_nested_categories_for_dups() {
585
    public function test_nested_categories_for_dups(): void {
Línea 586... Línea 586...
586
        global $DB;
586
        global $DB;
Línea 620... Línea 620...
620
    }
620
    }
Línea 621... Línea 621...
621
 
621
 
622
    /**
622
    /**
623
     * Nested categories with idnumber during course creation
623
     * Nested categories with idnumber during course creation
624
     */
624
     */
625
    public function test_nested_categories_idnumber() {
625
    public function test_nested_categories_idnumber(): void {
Línea 626... Línea 626...
626
        global $DB;
626
        global $DB;
627
 
627
 
628
        $this->imsplugin->set_config('nestedcategories', true);
628
        $this->imsplugin->set_config('nestedcategories', true);
Línea 690... Línea 690...
690
    }
690
    }
Línea 691... Línea 691...
691
 
691
 
692
    /**
692
    /**
693
     * Test that duplicate nested categories with idnumber are not created
693
     * Test that duplicate nested categories with idnumber are not created
694
     */
694
     */
695
    public function test_nested_categories_idnumber_for_dups() {
695
    public function test_nested_categories_idnumber_for_dups(): void {
Línea 696... Línea 696...
696
        global $DB;
696
        global $DB;
697
 
697
 
698
        $this->imsplugin->set_config('nestedcategories', true);
698
        $this->imsplugin->set_config('nestedcategories', true);
Línea 739... Línea 739...
739
    }
739
    }
Línea 740... Línea 740...
740
 
740
 
741
    /**
741
    /**
742
     * Test that nested categories with idnumber is not created if name is missing
742
     * Test that nested categories with idnumber is not created if name is missing
743
     */
743
     */
744
    public function test_categories_idnumber_missing_name() {
744
    public function test_categories_idnumber_missing_name(): void {
Línea 745... Línea 745...
745
        global $DB, $CFG;
745
        global $DB, $CFG;
746
 
746
 
747
        $this->imsplugin->set_config('nestedcategories', true);
747
        $this->imsplugin->set_config('nestedcategories', true);
Línea 783... Línea 783...
783
    }
783
    }
Línea 784... Línea 784...
784
 
784
 
785
    /**
785
    /**
786
     * Create category with name (nested categories not activated).
786
     * Create category with name (nested categories not activated).
787
     */
787
     */
788
    public function test_create_category_name_no_nested() {
788
    public function test_create_category_name_no_nested(): void {
Línea 789... Línea 789...
789
        global $DB;
789
        global $DB;
790
 
790
 
791
        $course = new \stdClass();
791
        $course = new \stdClass();
Línea 810... Línea 810...
810
    }
810
    }
Línea 811... Línea 811...
811
 
811
 
812
    /**
812
    /**
813
     * Find a category with name (nested categories not activated).
813
     * Find a category with name (nested categories not activated).
814
     */
814
     */
815
    public function test_find_category_name_no_nested() {
815
    public function test_find_category_name_no_nested(): void {
Línea 816... Línea 816...
816
        global $DB;
816
        global $DB;
817
 
817
 
818
        $cattop = $this->getDataGenerator()->create_category(array('name' => 'CAT-TOP'));
818
        $cattop = $this->getDataGenerator()->create_category(array('name' => 'CAT-TOP'));
Línea 843... Línea 843...
843
    }
843
    }
Línea 844... Línea 844...
844
 
844
 
845
    /**
845
    /**
846
     * Create category with idnumber (nested categories not activated).
846
     * Create category with idnumber (nested categories not activated).
847
     */
847
     */
848
    public function test_create_category_idnumber_no_nested() {
848
    public function test_create_category_idnumber_no_nested(): void {
Línea 849... Línea 849...
849
        global $DB;
849
        global $DB;
850
 
850
 
851
        $this->imsplugin->set_config('categoryidnumber', true);
851
        $this->imsplugin->set_config('categoryidnumber', true);
Línea 875... Línea 875...
875
    }
875
    }
Línea 876... Línea 876...
876
 
876
 
877
    /**
877
    /**
878
     * Find a category with idnumber (nested categories not activated).
878
     * Find a category with idnumber (nested categories not activated).
879
     */
879
     */
880
    public function test_find_category_idnumber_no_nested() {
880
    public function test_find_category_idnumber_no_nested(): void {
Línea 881... Línea 881...
881
        global $DB;
881
        global $DB;
882
 
882
 
883
        $this->imsplugin->set_config('categoryidnumber', true);
883
        $this->imsplugin->set_config('categoryidnumber', true);
Línea 917... Línea 917...
917
    }
917
    }
Línea 918... Línea 918...
918
 
918
 
919
    /**
919
    /**
920
     * Test that category with idnumber is not created if name is missing (nested categories not activated).
920
     * Test that category with idnumber is not created if name is missing (nested categories not activated).
921
     */
921
     */
922
    public function test_category_idnumber_missing_name_no_nested() {
922
    public function test_category_idnumber_missing_name_no_nested(): void {
Línea 923... Línea 923...
923
        global $DB;
923
        global $DB;
924
 
924
 
925
        $this->imsplugin->set_config('categoryidnumber', true);
925
        $this->imsplugin->set_config('categoryidnumber', true);
Línea 1082... Línea 1082...
1082
    }
1082
    }
Línea 1083... Línea 1083...
1083
 
1083
 
1084
    /**
1084
    /**
1085
     * IMS Enterprise enrolment task test.
1085
     * IMS Enterprise enrolment task test.
1086
     */
1086
     */
1087
    public function test_imsenterprise_cron_task() {
1087
    public function test_imsenterprise_cron_task(): void {
1088
        global $DB;
1088
        global $DB;
Línea 1089... Línea 1089...
1089
        $prevnusers = $DB->count_records('user');
1089
        $prevnusers = $DB->count_records('user');
1090
 
1090