Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 42... Línea 42...
42
class externallib_test extends \mod_assign\externallib_advanced_testcase {
42
class externallib_test extends \mod_assign\externallib_advanced_testcase {
Línea 43... Línea 43...
43
 
43
 
44
    /**
44
    /**
45
     * Test get_grades
45
     * Test get_grades
46
     */
46
     */
47
    public function test_get_grades() {
47
    public function test_get_grades(): void {
Línea 48... Línea 48...
48
        global $DB, $USER;
48
        global $DB, $USER;
49
 
49
 
50
        $this->resetAfterTest(true);
50
        $this->resetAfterTest(true);
Línea 142... Línea 142...
142
    }
142
    }
Línea 143... Línea 143...
143
 
143
 
144
    /**
144
    /**
145
     * Test get_assignments
145
     * Test get_assignments
146
     */
146
     */
147
    public function test_get_assignments() {
147
    public function test_get_assignments(): void {
Línea 148... Línea 148...
148
        global $DB, $USER, $CFG;
148
        global $DB, $USER, $CFG;
Línea 149... Línea 149...
149
 
149
 
Línea 330... Línea 330...
330
    }
330
    }
Línea 331... Línea 331...
331
 
331
 
332
    /**
332
    /**
333
     * Test get_assignments with submissionstatement.
333
     * Test get_assignments with submissionstatement.
334
     */
334
     */
335
    public function test_get_assignments_with_submissionstatement() {
335
    public function test_get_assignments_with_submissionstatement(): void {
Línea 336... Línea 336...
336
        global $DB, $USER, $CFG;
336
        global $DB, $USER, $CFG;
Línea 337... Línea 337...
337
 
337
 
Línea 388... Línea 388...
388
    /**
388
    /**
389
     * Test that get_assignments does not return intro attachments if submissionattachments enabled and there is no open submission.
389
     * Test that get_assignments does not return intro attachments if submissionattachments enabled and there is no open submission.
390
     *
390
     *
391
     * @covers \mod_assign_external::get_assignments
391
     * @covers \mod_assign_external::get_assignments
392
     */
392
     */
393
    public function test_get_assignments_when_submissionattachments_is_enabled() {
393
    public function test_get_assignments_when_submissionattachments_is_enabled(): void {
394
        global $DB;
394
        global $DB;
Línea 395... Línea 395...
395
 
395
 
Línea 396... Línea 396...
396
        $this->resetAfterTest(true);
396
        $this->resetAfterTest(true);
Línea 460... Línea 460...
460
    }
460
    }
Línea 461... Línea 461...
461
 
461
 
462
    /**
462
    /**
463
     * Test get_submissions
463
     * Test get_submissions
464
     */
464
     */
465
    public function test_get_submissions() {
465
    public function test_get_submissions(): void {
Línea 466... Línea 466...
466
        global $DB, $USER;
466
        global $DB, $USER;
467
 
467
 
468
        $this->resetAfterTest(true);
468
        $this->resetAfterTest(true);
Línea 560... Línea 560...
560
    }
560
    }
Línea 561... Línea 561...
561
 
561
 
562
    /**
562
    /**
563
     * Test get_submissions with teamsubmission enabled
563
     * Test get_submissions with teamsubmission enabled
564
     */
564
     */
565
    public function test_get_submissions_group_submission() {
565
    public function test_get_submissions_group_submission(): void {
Línea 566... Línea 566...
566
        global $DB;
566
        global $DB;
Línea 567... Línea 567...
567
 
567
 
Línea 606... Línea 606...
606
 
606
 
607
    /**
607
    /**
608
     * Test get_submissions with teamsubmission enabled
608
     * Test get_submissions with teamsubmission enabled
609
     * and a group having a higher attemptnumber than another
609
     * and a group having a higher attemptnumber than another
610
     */
610
     */
611
    public function test_get_submissions_group_submission_attemptnumber() {
611
    public function test_get_submissions_group_submission_attemptnumber(): void {
612
        global $DB;
612
        global $DB;
Línea 613... Línea 613...
613
        $this->resetAfterTest(true);
613
        $this->resetAfterTest(true);
614
 
614
 
Línea 686... Línea 686...
686
    }
686
    }
Línea 687... Línea 687...
687
 
687
 
688
    /**
688
    /**
689
     * Test get_user_flags
689
     * Test get_user_flags
690
     */
690
     */
691
    public function test_get_user_flags() {
691
    public function test_get_user_flags(): void {
Línea 692... Línea 692...
692
        global $DB, $USER;
692
        global $DB, $USER;
693
 
693
 
694
        $this->resetAfterTest(true);
694
        $this->resetAfterTest(true);
Línea 757... Línea 757...
757
    }
757
    }
Línea 758... Línea 758...
758
 
758
 
759
    /**
759
    /**
760
     * Test get_user_mappings
760
     * Test get_user_mappings
761
     */
761
     */
762
    public function test_get_user_mappings() {
762
    public function test_get_user_mappings(): void {
Línea 763... Línea 763...
763
        global $DB, $USER;
763
        global $DB, $USER;
764
 
764
 
765
        $this->resetAfterTest(true);
765
        $this->resetAfterTest(true);
Línea 818... Línea 818...
818
    }
818
    }
Línea 819... Línea 819...
819
 
819
 
820
    /**
820
    /**
821
     * Test lock_submissions
821
     * Test lock_submissions
822
     */
822
     */
823
    public function test_lock_submissions() {
823
    public function test_lock_submissions(): void {
Línea 824... Línea 824...
824
        global $DB, $USER;
824
        global $DB, $USER;
825
 
825
 
826
        $this->resetAfterTest(true);
826
        $this->resetAfterTest(true);
Línea 879... Línea 879...
879
    }
879
    }
Línea 880... Línea 880...
880
 
880
 
881
    /**
881
    /**
882
     * Test unlock_submissions
882
     * Test unlock_submissions
883
     */
883
     */
884
    public function test_unlock_submissions() {
884
    public function test_unlock_submissions(): void {
Línea 885... Línea 885...
885
        global $DB, $USER;
885
        global $DB, $USER;
886
 
886
 
887
        $this->resetAfterTest(true);
887
        $this->resetAfterTest(true);
Línea 945... Línea 945...
945
    }
945
    }
Línea 946... Línea 946...
946
 
946
 
947
    /**
947
    /**
948
     * Test submit_for_grading
948
     * Test submit_for_grading
949
     */
949
     */
950
    public function test_submit_for_grading() {
950
    public function test_submit_for_grading(): void {
Línea 951... Línea 951...
951
        global $DB, $USER;
951
        global $DB, $USER;
952
 
952
 
953
        $this->resetAfterTest(true);
953
        $this->resetAfterTest(true);
Línea 1001... Línea 1001...
1001
    }
1001
    }
Línea 1002... Línea 1002...
1002
 
1002
 
1003
    /**
1003
    /**
1004
     * Test save_user_extensions
1004
     * Test save_user_extensions
1005
     */
1005
     */
1006
    public function test_save_user_extensions() {
1006
    public function test_save_user_extensions(): void {
Línea 1007... Línea 1007...
1007
        global $DB, $USER;
1007
        global $DB, $USER;
1008
 
1008
 
1009
        $this->resetAfterTest(true);
1009
        $this->resetAfterTest(true);
Línea 1068... Línea 1068...
1068
    }
1068
    }
Línea 1069... Línea 1069...
1069
 
1069
 
1070
    /**
1070
    /**
1071
     * Test reveal_identities
1071
     * Test reveal_identities
1072
     */
1072
     */
1073
    public function test_reveal_identities() {
1073
    public function test_reveal_identities(): void {
Línea 1074... Línea 1074...
1074
        global $DB, $USER;
1074
        global $DB, $USER;
1075
 
1075
 
1076
        $this->resetAfterTest(true);
1076
        $this->resetAfterTest(true);
Línea 1128... Línea 1128...
1128
    }
1128
    }
Línea 1129... Línea 1129...
1129
 
1129
 
1130
    /**
1130
    /**
1131
     * Test revert_submissions_to_draft
1131
     * Test revert_submissions_to_draft
1132
     */
1132
     */
1133
    public function test_revert_submissions_to_draft() {
1133
    public function test_revert_submissions_to_draft(): void {
Línea 1134... Línea 1134...
1134
        global $DB, $USER;
1134
        global $DB, $USER;
1135
 
1135
 
1136
        $this->resetAfterTest(true);
1136
        $this->resetAfterTest(true);
Línea 1175... Línea 1175...
1175
    }
1175
    }
Línea 1176... Línea 1176...
1176
 
1176
 
1177
    /**
1177
    /**
1178
     * Test save_submission
1178
     * Test save_submission
1179
     */
1179
     */
1180
    public function test_save_submission() {
1180
    public function test_save_submission(): void {
Línea 1181... Línea 1181...
1181
        global $DB, $USER;
1181
        global $DB, $USER;
1182
 
1182
 
1183
        $this->resetAfterTest(true);
1183
        $this->resetAfterTest(true);
Línea 1266... Línea 1266...
1266
    }
1266
    }
Línea 1267... Línea 1267...
1267
 
1267
 
1268
    /**
1268
    /**
1269
     * Test save_grade
1269
     * Test save_grade
1270
     */
1270
     */
1271
    public function test_save_grade() {
1271
    public function test_save_grade(): void {
Línea 1272... Línea 1272...
1272
        global $DB, $USER;
1272
        global $DB, $USER;
1273
 
1273
 
1274
        $this->resetAfterTest(true);
1274
        $this->resetAfterTest(true);
Línea 1343... Línea 1343...
1343
    }
1343
    }
Línea 1344... Línea 1344...
1344
 
1344
 
1345
    /**
1345
    /**
1346
     * Test save grades with advanced grading data
1346
     * Test save grades with advanced grading data
1347
     */
1347
     */
1348
    public function test_save_grades_with_advanced_grading() {
1348
    public function test_save_grades_with_advanced_grading(): void {
Línea 1349... Línea 1349...
1349
        global $DB, $USER;
1349
        global $DB, $USER;
1350
 
1350
 
1351
        $this->resetAfterTest(true);
1351
        $this->resetAfterTest(true);
Línea 1493... Línea 1493...
1493
    }
1493
    }
Línea 1494... Línea 1494...
1494
 
1494
 
1495
    /**
1495
    /**
1496
     * Test save grades for a team submission
1496
     * Test save grades for a team submission
1497
     */
1497
     */
1498
    public function test_save_grades_with_group_submission() {
1498
    public function test_save_grades_with_group_submission(): void {
1499
        global $DB, $USER, $CFG;
1499
        global $DB, $USER, $CFG;
Línea 1500... Línea 1500...
1500
        require_once($CFG->dirroot . '/group/lib.php');
1500
        require_once($CFG->dirroot . '/group/lib.php');
1501
 
1501
 
Línea 1618... Línea 1618...
1618
    }
1618
    }
Línea 1619... Línea 1619...
1619
 
1619
 
1620
    /**
1620
    /**
1621
     * Test copy_previous_attempt
1621
     * Test copy_previous_attempt
1622
     */
1622
     */
1623
    public function test_copy_previous_attempt() {
1623
    public function test_copy_previous_attempt(): void {
Línea 1624... Línea 1624...
1624
        global $DB, $USER;
1624
        global $DB, $USER;
1625
 
1625
 
1626
        $this->resetAfterTest(true);
1626
        $this->resetAfterTest(true);
Línea 1695... Línea 1695...
1695
    }
1695
    }
Línea 1696... Línea 1696...
1696
 
1696
 
1697
    /**
1697
    /**
1698
     * Test set_user_flags
1698
     * Test set_user_flags
1699
     */
1699
     */
1700
    public function test_set_user_flags() {
1700
    public function test_set_user_flags(): void {
Línea 1701... Línea 1701...
1701
        global $DB, $USER;
1701
        global $DB, $USER;
1702
 
1702
 
1703
        $this->resetAfterTest(true);
1703
        $this->resetAfterTest(true);
Línea 1781... Línea 1781...
1781
    }
1781
    }
Línea 1782... Línea 1782...
1782
 
1782
 
1783
    /**
1783
    /**
1784
     * Test view_grading_table
1784
     * Test view_grading_table
1785
     */
1785
     */
1786
    public function test_view_grading_table_invalid_instance() {
1786
    public function test_view_grading_table_invalid_instance(): void {
Línea 1787... Línea 1787...
1787
        global $DB;
1787
        global $DB;
Línea 1788... Línea 1788...
1788
 
1788
 
Línea 1800... Línea 1800...
1800
    }
1800
    }
Línea 1801... Línea 1801...
1801
 
1801
 
1802
    /**
1802
    /**
1803
     * Test view_grading_table
1803
     * Test view_grading_table
1804
     */
1804
     */
1805
    public function test_view_grading_table_not_enrolled() {
1805
    public function test_view_grading_table_not_enrolled(): void {
Línea 1806... Línea 1806...
1806
        global $DB;
1806
        global $DB;
Línea 1807... Línea 1807...
1807
 
1807
 
Línea 1822... Línea 1822...
1822
    }
1822
    }
Línea 1823... Línea 1823...
1823
 
1823
 
1824
    /**
1824
    /**
1825
     * Test view_grading_table
1825
     * Test view_grading_table
1826
     */
1826
     */
1827
    public function test_view_grading_table_correct() {
1827
    public function test_view_grading_table_correct(): void {
Línea 1828... Línea 1828...
1828
        global $DB;
1828
        global $DB;
Línea 1829... Línea 1829...
1829
 
1829
 
Línea 1861... Línea 1861...
1861
    }
1861
    }
Línea 1862... Línea 1862...
1862
 
1862
 
1863
    /**
1863
    /**
1864
     * Test view_grading_table
1864
     * Test view_grading_table
1865
     */
1865
     */
1866
    public function test_view_grading_table_without_capability() {
1866
    public function test_view_grading_table_without_capability(): void {
Línea 1867... Línea 1867...
1867
        global $DB;
1867
        global $DB;
Línea 1868... Línea 1868...
1868
 
1868
 
Línea 1893... Línea 1893...
1893
    }
1893
    }
Línea 1894... Línea 1894...
1894
 
1894
 
1895
    /**
1895
    /**
1896
     * Test subplugins availability
1896
     * Test subplugins availability
1897
     */
1897
     */
1898
    public function test_subplugins_availability() {
1898
    public function test_subplugins_availability(): void {
Línea 1899... Línea 1899...
1899
        global $CFG;
1899
        global $CFG;
1900
 
1900
 
Línea 1936... Línea 1936...
1936
    }
1936
    }
Línea 1937... Línea 1937...
1937
 
1937
 
1938
    /**
1938
    /**
1939
     * Test test_view_submission_status
1939
     * Test test_view_submission_status
1940
     */
1940
     */
1941
    public function test_view_submission_status() {
1941
    public function test_view_submission_status(): void {
Línea 1942... Línea 1942...
1942
        global $DB;
1942
        global $DB;
Línea 1943... Línea 1943...
1943
 
1943
 
Línea 2005... Línea 2005...
2005
    }
2005
    }
Línea 2006... Línea 2006...
2006
 
2006
 
2007
    /**
2007
    /**
2008
     * Test get_submission_status for a draft submission.
2008
     * Test get_submission_status for a draft submission.
2009
     */
2009
     */
2010
    public function test_get_submission_status_in_draft_status() {
2010
    public function test_get_submission_status_in_draft_status(): void {
Línea 2011... Línea 2011...
2011
        $this->resetAfterTest(true);
2011
        $this->resetAfterTest(true);
2012
 
2012
 
Línea 2071... Línea 2071...
2071
    }
2071
    }
Línea 2072... Línea 2072...
2072
 
2072
 
2073
    /**
2073
    /**
2074
     * Test get_submission_status for a submitted submission.
2074
     * Test get_submission_status for a submitted submission.
2075
     */
2075
     */
2076
    public function test_get_submission_status_in_submission_status() {
2076
    public function test_get_submission_status_in_submission_status(): void {
Línea 2077... Línea 2077...
2077
        $this->resetAfterTest(true);
2077
        $this->resetAfterTest(true);
Línea 2078... Línea 2078...
2078
 
2078
 
Línea 2104... Línea 2104...
2104
    }
2104
    }
Línea 2105... Línea 2105...
2105
 
2105
 
2106
    /**
2106
    /**
2107
     * Test get_submission_status using the teacher role.
2107
     * Test get_submission_status using the teacher role.
2108
     */
2108
     */
2109
    public function test_get_submission_status_in_submission_status_for_teacher() {
2109
    public function test_get_submission_status_in_submission_status_for_teacher(): void {
2110
        global $DB;
2110
        global $DB;
Línea 2111... Línea 2111...
2111
        $this->resetAfterTest(true);
2111
        $this->resetAfterTest(true);
Línea 2177... Línea 2177...
2177
    }
2177
    }
Línea 2178... Línea 2178...
2178
 
2178
 
2179
    /**
2179
    /**
2180
     * Test get_submission_status for a reopened submission.
2180
     * Test get_submission_status for a reopened submission.
2181
     */
2181
     */
2182
    public function test_get_submission_status_in_reopened_status() {
2182
    public function test_get_submission_status_in_reopened_status(): void {
Línea 2183... Línea 2183...
2183
        global $USER;
2183
        global $USER;
Línea 2184... Línea 2184...
2184
 
2184
 
Línea 2279... Línea 2279...
2279
    }
2279
    }
Línea 2280... Línea 2280...
2280
 
2280
 
2281
    /**
2281
    /**
2282
     * Test access control for get_submission_status.
2282
     * Test access control for get_submission_status.
2283
     */
2283
     */
2284
    public function test_get_submission_status_access_control() {
2284
    public function test_get_submission_status_access_control(): void {
Línea 2285... Línea 2285...
2285
        $this->resetAfterTest(true);
2285
        $this->resetAfterTest(true);
Línea 2286... Línea 2286...
2286
 
2286
 
Línea 2295... Línea 2295...
2295
    }
2295
    }
Línea 2296... Línea 2296...
2296
 
2296
 
2297
    /**
2297
    /**
2298
     * Test hidden grader for get_submission_status.
2298
     * Test hidden grader for get_submission_status.
2299
     */
2299
     */
2300
    public function test_get_submission_status_hidden_grader() {
2300
    public function test_get_submission_status_hidden_grader(): void {
Línea 2301... Línea 2301...
2301
        $this->resetAfterTest(true);
2301
        $this->resetAfterTest(true);
Línea 2302... Línea 2302...
2302
 
2302
 
Línea 2356... Línea 2356...
2356
    }
2356
    }
Línea 2357... Línea 2357...
2357
 
2357
 
2358
    /**
2358
    /**
2359
     * Test get_submission_status with override for student.
2359
     * Test get_submission_status with override for student.
2360
     */
2360
     */
2361
    public function test_get_submission_status_with_override() {
2361
    public function test_get_submission_status_with_override(): void {
Línea 2362... Línea 2362...
2362
        global $DB;
2362
        global $DB;
Línea 2363... Línea 2363...
2363
 
2363
 
Línea 2420... Línea 2420...
2420
    /**
2420
    /**
2421
     * Test get_submission_status with time limit for student.
2421
     * Test get_submission_status with time limit for student.
2422
     *
2422
     *
2423
     * @covers \mod_assign_external::get_submission_status
2423
     * @covers \mod_assign_external::get_submission_status
2424
     */
2424
     */
2425
    public function test_get_submission_status_with_time_limit_enabled() {
2425
    public function test_get_submission_status_with_time_limit_enabled(): void {
2426
        $this->resetAfterTest();
2426
        $this->resetAfterTest();
Línea 2427... Línea 2427...
2427
 
2427
 
Línea 2428... Línea 2428...
2428
        set_config('enabletimelimit', '1', 'assign');
2428
        set_config('enabletimelimit', '1', 'assign');
Línea 2494... Línea 2494...
2494
    }
2494
    }
Línea 2495... Línea 2495...
2495
 
2495
 
2496
    /**
2496
    /**
2497
     * get_participant should throw an excaption if the requested assignment doesn't exist.
2497
     * get_participant should throw an excaption if the requested assignment doesn't exist.
2498
     */
2498
     */
2499
    public function test_get_participant_no_assignment() {
2499
    public function test_get_participant_no_assignment(): void {
2500
        $this->resetAfterTest(true);
2500
        $this->resetAfterTest(true);
2501
        $this->expectException(\moodle_exception::class);
2501
        $this->expectException(\moodle_exception::class);
2502
        mod_assign_external::get_participant('-1', '-1', false);
2502
        mod_assign_external::get_participant('-1', '-1', false);
Línea 2503... Línea 2503...
2503
    }
2503
    }
2504
 
2504
 
2505
    /**
2505
    /**
2506
     * get_participant should throw a require_login_exception if the user doesn't have access
2506
     * get_participant should throw a require_login_exception if the user doesn't have access
2507
     * to view assignments.
2507
     * to view assignments.
2508
     */
2508
     */
2509
    public function test_get_participant_no_view_capability() {
2509
    public function test_get_participant_no_view_capability(): void {
Línea 2510... Línea 2510...
2510
        global $DB;
2510
        global $DB;
2511
        $this->resetAfterTest(true);
2511
        $this->resetAfterTest(true);
Línea 2526... Línea 2526...
2526
 
2526
 
2527
    /**
2527
    /**
2528
     * get_participant should throw a required_capability_exception if the user doesn't have access
2528
     * get_participant should throw a required_capability_exception if the user doesn't have access
2529
     * to view assignment grades.
2529
     * to view assignment grades.
2530
     */
2530
     */
2531
    public function test_get_participant_no_grade_capability() {
2531
    public function test_get_participant_no_grade_capability(): void {
2532
        global $DB;
2532
        global $DB;
Línea 2533... Línea 2533...
2533
        $this->resetAfterTest(true);
2533
        $this->resetAfterTest(true);
2534
 
2534
 
Línea 2550... Línea 2550...
2550
    }
2550
    }
Línea 2551... Línea 2551...
2551
 
2551
 
2552
    /**
2552
    /**
2553
     * get_participant should throw an exception if the user isn't enrolled in the course.
2553
     * get_participant should throw an exception if the user isn't enrolled in the course.
2554
     */
2554
     */
2555
    public function test_get_participant_no_participant() {
2555
    public function test_get_participant_no_participant(): void {
2556
        global $DB;
2556
        global $DB;
Línea 2557... Línea 2557...
2557
        $this->resetAfterTest(true);
2557
        $this->resetAfterTest(true);
2558
 
2558
 
Línea 2570... Línea 2570...
2570
 
2570
 
2571
    /**
2571
    /**
2572
     * get_participant should return a summarised list of details with a different fullname if blind
2572
     * get_participant should return a summarised list of details with a different fullname if blind
2573
     * marking is on for the requested assignment.
2573
     * marking is on for the requested assignment.
2574
     */
2574
     */
2575
    public function test_get_participant_blind_marking() {
2575
    public function test_get_participant_blind_marking(): void {
2576
        global $DB;
2576
        global $DB;
Línea 2577... Línea 2577...
2577
        $this->resetAfterTest(true);
2577
        $this->resetAfterTest(true);
2578
 
2578
 
Línea 2600... Línea 2600...
2600
    }
2600
    }
Línea 2601... Línea 2601...
2601
 
2601
 
2602
    /**
2602
    /**
2603
     * get_participant should return a summarised list of details if requested.
2603
     * get_participant should return a summarised list of details if requested.
2604
     */
2604
     */
2605
    public function test_get_participant_no_user() {
2605
    public function test_get_participant_no_user(): void {
2606
        global $DB;
2606
        global $DB;
Línea 2607... Línea 2607...
2607
        $this->resetAfterTest(true);
2607
        $this->resetAfterTest(true);
2608
 
2608
 
Línea 2655... Línea 2655...
2655
    }
2655
    }
Línea 2656... Línea 2656...
2656
 
2656
 
2657
    /**
2657
    /**
2658
     * get_participant should return user details if requested.
2658
     * get_participant should return user details if requested.
2659
     */
2659
     */
2660
    public function test_get_participant_full_details() {
2660
    public function test_get_participant_full_details(): void {
2661
        global $DB;
2661
        global $DB;
Línea 2662... Línea 2662...
2662
        $this->resetAfterTest(true);
2662
        $this->resetAfterTest(true);
2663
 
2663
 
Línea 2685... Línea 2685...
2685
 
2685
 
2686
    /**
2686
    /**
2687
     * get_participant should return group details if a group submission was
2687
     * get_participant should return group details if a group submission was
2688
     * submitted.
2688
     * submitted.
2689
     */
2689
     */
2690
    public function test_get_participant_group_submission() {
2690
    public function test_get_participant_group_submission(): void {
Línea 2691... Línea 2691...
2691
        global $DB;
2691
        global $DB;
Línea 2692... Línea 2692...
2692
 
2692
 
Línea 2739... Línea 2739...
2739
     * @param array $assignconfig the config to use when creating the assignment.
2739
     * @param array $assignconfig the config to use when creating the assignment.
2740
     * @param array $enrolconfig the enrolement to create.
2740
     * @param array $enrolconfig the enrolement to create.
2741
     * @param array $expectedproperties array of expected assign properties.
2741
     * @param array $expectedproperties array of expected assign properties.
2742
     */
2742
     */
2743
    public function test_get_participant_relative_dates(array $courseconfig, array $assignconfig, array $enrolconfig,
2743
    public function test_get_participant_relative_dates(array $courseconfig, array $assignconfig, array $enrolconfig,
2744
            array $expectedproperties) {
2744
            array $expectedproperties): void {
2745
        $this->resetAfterTest();
2745
        $this->resetAfterTest();
Línea 2746... Línea 2746...
2746
 
2746
 
Línea 2747... Línea 2747...
2747
        set_config('enablecourserelativedates', true); // Enable relative dates at site level.
2747
        set_config('enablecourserelativedates', true); // Enable relative dates at site level.
Línea 2794... Línea 2794...
2794
    /**
2794
    /**
2795
     * Test for mod_assign_external::list_participants().
2795
     * Test for mod_assign_external::list_participants().
2796
     *
2796
     *
2797
     * @throws coding_exception
2797
     * @throws coding_exception
2798
     */
2798
     */
2799
    public function test_list_participants_user_info_with_special_characters() {
2799
    public function test_list_participants_user_info_with_special_characters(): void {
2800
        global $CFG, $DB;
2800
        global $CFG, $DB;
2801
        $this->resetAfterTest(true);
2801
        $this->resetAfterTest(true);
2802
        $CFG->showuseridentity = 'idnumber,email,phone1,phone2,department,institution';
2802
        $CFG->showuseridentity = 'idnumber,email,phone1,phone2,department,institution';
Línea 2803... Línea 2803...
2803
 
2803
 
Línea 2845... Línea 2845...
2845
    }
2845
    }
Línea 2846... Línea 2846...
2846
 
2846
 
2847
    /**
2847
    /**
2848
     * Test for the type of the user-related properties in mod_assign_external::list_participants_returns().
2848
     * Test for the type of the user-related properties in mod_assign_external::list_participants_returns().
2849
     */
2849
     */
2850
    public function test_list_participants_returns_user_property_types() {
2850
    public function test_list_participants_returns_user_property_types(): void {
2851
        // Get user properties.
2851
        // Get user properties.
2852
        $userdesc = core_user_external::user_description();
2852
        $userdesc = core_user_external::user_description();
2853
        $this->assertTrue(isset($userdesc->keys));
2853
        $this->assertTrue(isset($userdesc->keys));
Línea 2880... Línea 2880...
2880
    /**
2880
    /**
2881
     * Test for WS returning group.
2881
     * Test for WS returning group.
2882
     * @covers ::get_participant
2882
     * @covers ::get_participant
2883
     * @covers ::list_participants
2883
     * @covers ::list_participants
2884
     */
2884
     */
2885
    public function test_participants_info_with_groups() {
2885
    public function test_participants_info_with_groups(): void {
2886
        global $CFG;
2886
        global $CFG;
2887
        $this->resetAfterTest(true);
2887
        $this->resetAfterTest(true);
2888
        $CFG->showuseridentity = 'idnumber,email,phone1,phone2,department,institution';
2888
        $CFG->showuseridentity = 'idnumber,email,phone1,phone2,department,institution';
Línea 2889... Línea 2889...
2889
 
2889
 
Línea 2926... Línea 2926...
2926
    }
2926
    }
Línea 2927... Línea 2927...
2927
 
2927
 
2928
    /**
2928
    /**
2929
     * Test test_view_assign
2929
     * Test test_view_assign
2930
     */
2930
     */
2931
    public function test_view_assign() {
2931
    public function test_view_assign(): void {
Línea 2932... Línea 2932...
2932
        global $CFG;
2932
        global $CFG;
2933
 
2933