Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 108... Línea 108...
108
    }
108
    }
Línea 109... Línea 109...
109
 
109
 
110
    /**
110
    /**
111
     * Test that settings types to be added to quiz settings, are part of quiz_settings persistent class.
111
     * Test that settings types to be added to quiz settings, are part of quiz_settings persistent class.
112
     */
112
     */
113
    public function test_setting_elements_are_part_of_quiz_settings_table() {
113
    public function test_setting_elements_are_part_of_quiz_settings_table(): void {
114
        $dbsettings = (array) (new seb_quiz_settings())->to_record();
114
        $dbsettings = (array) (new seb_quiz_settings())->to_record();
115
        $settingelements = settings_provider::get_seb_config_elements();
115
        $settingelements = settings_provider::get_seb_config_elements();
Línea 116... Línea 116...
116
        $settingelements = (array) $this->strip_all_prefixes((object) $settingelements);
116
        $settingelements = (array) $this->strip_all_prefixes((object) $settingelements);
Línea 122... Línea 122...
122
    }
122
    }
Línea 123... Línea 123...
123
 
123
 
124
    /**
124
    /**
125
     * Make sure that all SEB settings have related capabilities.
125
     * Make sure that all SEB settings have related capabilities.
126
     */
126
     */
127
    public function test_that_all_seb_settings_have_capabilities() {
127
    public function test_that_all_seb_settings_have_capabilities(): void {
128
        foreach (settings_provider::get_seb_config_elements() as $name => $notused) {
128
        foreach (settings_provider::get_seb_config_elements() as $name => $notused) {
129
            $this->assertNotEmpty(get_capability_info(settings_provider::build_setting_capability_name($name)));
129
            $this->assertNotEmpty(get_capability_info(settings_provider::build_setting_capability_name($name)));
130
        }
130
        }
Línea 131... Línea 131...
131
    }
131
    }
132
 
132
 
133
    /**
133
    /**
134
     * Test that setting defaults only refer to settings defined in setting types.
134
     * Test that setting defaults only refer to settings defined in setting types.
135
     */
135
     */
136
    public function test_setting_defaults_are_part_of_file_types() {
136
    public function test_setting_defaults_are_part_of_file_types(): void {
Línea 137... Línea 137...
137
        $settingelements = settings_provider::get_seb_config_elements();
137
        $settingelements = settings_provider::get_seb_config_elements();
138
        $settingdefaults = settings_provider::get_seb_config_element_defaults();
138
        $settingdefaults = settings_provider::get_seb_config_element_defaults();
Línea 144... Línea 144...
144
    }
144
    }
Línea 145... Línea 145...
145
 
145
 
146
    /**
146
    /**
147
     * Test that setting types only refer to settings defined in setting types.
147
     * Test that setting types only refer to settings defined in setting types.
148
     */
148
     */
149
    public function test_setting_types_are_part_of_file_types() {
149
    public function test_setting_types_are_part_of_file_types(): void {
150
        $settingelements = settings_provider::get_seb_config_elements();
150
        $settingelements = settings_provider::get_seb_config_elements();
Línea 151... Línea 151...
151
        $settingtypes = settings_provider::get_seb_config_element_types();
151
        $settingtypes = settings_provider::get_seb_config_element_types();
152
 
152
 
Línea 172... Línea 172...
172
    }
172
    }
Línea 173... Línea 173...
173
 
173
 
174
    /**
174
    /**
175
     * Test hideif rules.
175
     * Test hideif rules.
176
     */
176
     */
177
    public function test_hideifs() {
177
    public function test_hideifs(): void {
Línea 178... Línea 178...
178
        $settinghideifs = settings_provider::get_quiz_hideifs();
178
        $settinghideifs = settings_provider::get_quiz_hideifs();
Línea 179... Línea 179...
179
 
179
 
Línea 530... Línea 530...
530
    }
530
    }
Línea 531... Línea 531...
531
 
531
 
532
    /**
532
    /**
533
     * Test that setting hideif rules only refer to settings defined in setting types, including the conditions.
533
     * Test that setting hideif rules only refer to settings defined in setting types, including the conditions.
534
     */
534
     */
535
    public function test_setting_hideifs_are_part_of_file_types() {
535
    public function test_setting_hideifs_are_part_of_file_types(): void {
536
        $settingelements = settings_provider::get_seb_config_elements();
536
        $settingelements = settings_provider::get_seb_config_elements();
Línea 537... Línea 537...
537
        $settinghideifs = settings_provider::get_quiz_hideifs();
537
        $settinghideifs = settings_provider::get_quiz_hideifs();
538
 
538
 
Línea 557... Línea 557...
557
    }
557
    }
Línea 558... Línea 558...
558
 
558
 
559
    /**
559
    /**
560
     * Test that exception thrown if we try to build capability name from the incorrect setting name.
560
     * Test that exception thrown if we try to build capability name from the incorrect setting name.
561
     */
561
     */
562
    public function test_build_setting_capability_name_incorrect_setting() {
562
    public function test_build_setting_capability_name_incorrect_setting(): void {
563
        $this->expectException(\coding_exception::class);
563
        $this->expectException(\coding_exception::class);
Línea 564... Línea 564...
564
        $this->expectExceptionMessage('Incorrect SEB quiz setting broken');
564
        $this->expectExceptionMessage('Incorrect SEB quiz setting broken');
565
 
565
 
Línea 566... Línea 566...
566
        $broken = settings_provider::build_setting_capability_name('broken');
566
        $broken = settings_provider::build_setting_capability_name('broken');
567
    }
567
    }
568
 
568
 
569
    /**
569
    /**
570
     * Test we can build capability name from the the setting name.
570
     * Test we can build capability name from the the setting name.
571
     */
571
     */
572
    public function test_build_setting_capability_name_correct_setting() {
572
    public function test_build_setting_capability_name_correct_setting(): void {
Línea 573... Línea 573...
573
        foreach (settings_provider::get_seb_config_elements() as $name => $type) {
573
        foreach (settings_provider::get_seb_config_elements() as $name => $type) {
Línea 580... Línea 580...
580
 
580
 
581
 
581
 
582
    /**
582
    /**
583
     * Test can check if can manage SEB settings respecting settings structure.
583
     * Test can check if can manage SEB settings respecting settings structure.
584
     */
584
     */
585
    public function test_can_manage_seb_config_setting() {
585
    public function test_can_manage_seb_config_setting(): void {
586
        $this->resetAfterTest();
586
        $this->resetAfterTest();
Línea 587... Línea 587...
587
        $this->setAdminUser();
587
        $this->setAdminUser();
Línea 624... Línea 624...
624
     *
624
     *
625
     * @param string $settingcapability Setting capability to check manual option against.
625
     * @param string $settingcapability Setting capability to check manual option against.
626
     *
626
     *
627
     * @dataProvider settings_capability_data_provider
627
     * @dataProvider settings_capability_data_provider
628
     */
628
     */
629
    public function test_get_requiresafeexambrowser_options($settingcapability) {
629
    public function test_get_requiresafeexambrowser_options($settingcapability): void {
630
        $this->resetAfterTest();
630
        $this->resetAfterTest();
631
        $this->setAdminUser();
631
        $this->setAdminUser();
632
        $this->course = $this->getDataGenerator()->create_course();
632
        $this->course = $this->getDataGenerator()->create_course();
Línea 633... Línea 633...
633
 
633
 
Línea 692... Línea 692...
692
    }
692
    }
Línea 693... Línea 693...
693
 
693
 
694
    /**
694
    /**
695
     * Test SEB usage options with conflicting permissions.
695
     * Test SEB usage options with conflicting permissions.
696
     */
696
     */
697
    public function test_get_requiresafeexambrowser_options_with_conflicting_permissions() {
697
    public function test_get_requiresafeexambrowser_options_with_conflicting_permissions(): void {
698
        $this->resetAfterTest();
698
        $this->resetAfterTest();
699
        $this->setAdminUser();
699
        $this->setAdminUser();
Línea 700... Línea 700...
700
        $this->course = $this->getDataGenerator()->create_course();
700
        $this->course = $this->getDataGenerator()->create_course();
Línea 719... Línea 719...
719
    }
719
    }
Línea 720... Línea 720...
720
 
720
 
721
    /**
721
    /**
722
     * Test that SEB options and templates are frozen if conflicting permissions.
722
     * Test that SEB options and templates are frozen if conflicting permissions.
723
     */
723
     */
724
    public function test_form_elements_are_frozen_if_conflicting_permissions() {
724
    public function test_form_elements_are_frozen_if_conflicting_permissions(): void {
725
        $this->resetAfterTest();
725
        $this->resetAfterTest();
726
        $this->setAdminUser();
726
        $this->setAdminUser();
Línea 727... Línea 727...
727
        $this->course = $this->getDataGenerator()->create_course();
727
        $this->course = $this->getDataGenerator()->create_course();
Línea 753... Línea 753...
753
    }
753
    }
Línea 754... Línea 754...
754
 
754
 
755
    /**
755
    /**
756
     * Test that All settings are frozen if quiz was attempted and use seb with manual settings.
756
     * Test that All settings are frozen if quiz was attempted and use seb with manual settings.
757
     */
757
     */
758
    public function test_form_elements_are_locked_when_quiz_attempted_manual() {
758
    public function test_form_elements_are_locked_when_quiz_attempted_manual(): void {
759
        $this->resetAfterTest();
759
        $this->resetAfterTest();
Línea 760... Línea 760...
760
        $this->course = $this->getDataGenerator()->create_course();
760
        $this->course = $this->getDataGenerator()->create_course();
761
 
761
 
Línea 782... Línea 782...
782
    }
782
    }
Línea 783... Línea 783...
783
 
783
 
784
    /**
784
    /**
785
     * Test that All settings are frozen if a quiz was attempted and use template.
785
     * Test that All settings are frozen if a quiz was attempted and use template.
786
     */
786
     */
787
    public function test_form_elements_are_locked_when_quiz_attempted_template() {
787
    public function test_form_elements_are_locked_when_quiz_attempted_template(): void {
788
        $this->resetAfterTest();
788
        $this->resetAfterTest();
789
        $this->setAdminUser();
789
        $this->setAdminUser();
Línea 790... Línea 790...
790
        $this->course = $this->getDataGenerator()->create_course();
790
        $this->course = $this->getDataGenerator()->create_course();
Línea 819... Línea 819...
819
    }
819
    }
Línea 820... Línea 820...
820
 
820
 
821
    /**
821
    /**
822
     * Test Show Safe Exam Browser download button setting in the form.
822
     * Test Show Safe Exam Browser download button setting in the form.
823
     */
823
     */
824
    public function test_showsebdownloadlink_in_form() {
824
    public function test_showsebdownloadlink_in_form(): void {
825
        $this->resetAfterTest();
825
        $this->resetAfterTest();
826
        $this->setAdminUser();
826
        $this->setAdminUser();
Línea 827... Línea 827...
827
        $this->course = $this->getDataGenerator()->create_course();
827
        $this->course = $this->getDataGenerator()->create_course();
Línea 846... Línea 846...
846
    }
846
    }
Línea 847... Línea 847...
847
 
847
 
848
    /**
848
    /**
849
     * Test Allowed Browser Exam Keys setting in the form.
849
     * Test Allowed Browser Exam Keys setting in the form.
850
     */
850
     */
851
    public function test_allowedbrowserexamkeys_in_form() {
851
    public function test_allowedbrowserexamkeys_in_form(): void {
852
        $this->resetAfterTest();
852
        $this->resetAfterTest();
853
        $this->setAdminUser();
853
        $this->setAdminUser();
Línea 854... Línea 854...
854
        $this->course = $this->getDataGenerator()->create_course();
854
        $this->course = $this->getDataGenerator()->create_course();
Línea 872... Línea 872...
872
    }
872
    }
Línea 873... Línea 873...
873
 
873
 
874
    /**
874
    /**
875
     * Test the validation of a seb config file.
875
     * Test the validation of a seb config file.
876
     */
876
     */
877
    public function test_validate_draftarea_configfile_success() {
877
    public function test_validate_draftarea_configfile_success(): void {
Línea 878... Línea 878...
878
        $this->resetAfterTest();
878
        $this->resetAfterTest();
879
 
879
 
880
        $user = $this->getDataGenerator()->create_user();
880
        $user = $this->getDataGenerator()->create_user();
Línea 889... Línea 889...
889
    }
889
    }
Línea 890... Línea 890...
890
 
890
 
891
    /**
891
    /**
892
     * Test the validation of a missing seb config file.
892
     * Test the validation of a missing seb config file.
893
     */
893
     */
894
    public function test_validate_draftarea_configfile_failure() {
894
    public function test_validate_draftarea_configfile_failure(): void {
Línea 895... Línea 895...
895
        $this->resetAfterTest();
895
        $this->resetAfterTest();
896
 
896
 
897
        $user = $this->getDataGenerator()->create_user();
897
        $user = $this->getDataGenerator()->create_user();
Línea 903... Línea 903...
903
    }
903
    }
Línea 904... Línea 904...
904
 
904
 
905
    /**
905
    /**
906
     * Test obtaining the draftarea content.
906
     * Test obtaining the draftarea content.
907
     */
907
     */
908
    public function test_get_current_user_draft_file() {
908
    public function test_get_current_user_draft_file(): void {
Línea 909... Línea 909...
909
        $this->resetAfterTest();
909
        $this->resetAfterTest();
910
 
910
 
Línea 920... Línea 920...
920
    }
920
    }
Línea 921... Línea 921...
921
 
921
 
922
    /**
922
    /**
923
     * Test saving files from the user draft area into the quiz context area storage.
923
     * Test saving files from the user draft area into the quiz context area storage.
924
     */
924
     */
925
    public function test_save_filemanager_sebconfigfile_draftarea() {
925
    public function test_save_filemanager_sebconfigfile_draftarea(): void {
926
        $this->resetAfterTest();
926
        $this->resetAfterTest();
927
        $this->course = $this->getDataGenerator()->create_course();
927
        $this->course = $this->getDataGenerator()->create_course();
928
        $this->quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $this->course->id]);
928
        $this->quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $this->course->id]);
929
        $this->context = \context_module::instance($this->quiz->cmid);
929
        $this->context = \context_module::instance($this->quiz->cmid);
Línea 942... Línea 942...
942
    }
942
    }
Línea 943... Línea 943...
943
 
943
 
944
    /**
944
    /**
945
     * Test deleting the $this->quiz->cmid itemid from the file area.
945
     * Test deleting the $this->quiz->cmid itemid from the file area.
946
     */
946
     */
947
    public function test_delete_uploaded_config_file() {
947
    public function test_delete_uploaded_config_file(): void {
948
        $this->resetAfterTest();
948
        $this->resetAfterTest();
949
        $this->course = $this->getDataGenerator()->create_course();
949
        $this->course = $this->getDataGenerator()->create_course();
950
        $this->quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $this->course->id]);
950
        $this->quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $this->course->id]);
951
        $this->context = \context_module::instance($this->quiz->cmid);
951
        $this->context = \context_module::instance($this->quiz->cmid);
Línea 968... Línea 968...
968
    }
968
    }
Línea 969... Línea 969...
969
 
969
 
970
    /**
970
    /**
971
     * Test getting the file from the context module id file area.
971
     * Test getting the file from the context module id file area.
972
     */
972
     */
973
    public function test_get_module_context_sebconfig_file() {
973
    public function test_get_module_context_sebconfig_file(): void {
974
        $this->resetAfterTest();
974
        $this->resetAfterTest();
Línea 975... Línea 975...
975
        $this->setAdminUser();
975
        $this->setAdminUser();
976
 
976
 
Línea 999... Línea 999...
999
    }
999
    }
Línea 1000... Línea 1000...
1000
 
1000
 
1001
    /**
1001
    /**
1002
     * Test file manager options.
1002
     * Test file manager options.
1003
     */
1003
     */
1004
    public function test_get_filemanager_options() {
1004
    public function test_get_filemanager_options(): void {
1005
        $expected = [
1005
        $expected = [
1006
            'subdirs' => 0,
1006
            'subdirs' => 0,
1007
            'maxfiles' => 1,
1007
            'maxfiles' => 1,
1008
            'accepted_types' => ['.seb']
1008
            'accepted_types' => ['.seb']
Línea 1011... Línea 1011...
1011
    }
1011
    }
Línea 1012... Línea 1012...
1012
 
1012
 
1013
    /**
1013
    /**
1014
     * Test that users can or can not configure seb settings.
1014
     * Test that users can or can not configure seb settings.
1015
     */
1015
     */
1016
    public function test_can_configure_seb() {
1016
    public function test_can_configure_seb(): void {
Línea 1017... Línea 1017...
1017
        $this->resetAfterTest();
1017
        $this->resetAfterTest();
1018
 
1018
 
1019
        $this->course = $this->getDataGenerator()->create_course();
1019
        $this->course = $this->getDataGenerator()->create_course();
Línea 1032... Línea 1032...
1032
    }
1032
    }
Línea 1033... Línea 1033...
1033
 
1033
 
1034
    /**
1034
    /**
1035
     * Test that users can or can not use seb template.
1035
     * Test that users can or can not use seb template.
1036
     */
1036
     */
1037
    public function test_can_use_seb_template() {
1037
    public function test_can_use_seb_template(): void {
Línea 1038... Línea 1038...
1038
        $this->resetAfterTest();
1038
        $this->resetAfterTest();
1039
 
1039
 
1040
        $this->course = $this->getDataGenerator()->create_course();
1040
        $this->course = $this->getDataGenerator()->create_course();
Línea 1053... Línea 1053...
1053
    }
1053
    }
Línea 1054... Línea 1054...
1054
 
1054
 
1055
    /**
1055
    /**
1056
     * Test that users can or can not upload seb config file.
1056
     * Test that users can or can not upload seb config file.
1057
     */
1057
     */
1058
    public function test_can_upload_seb_file() {
1058
    public function test_can_upload_seb_file(): void {
Línea 1059... Línea 1059...
1059
        $this->resetAfterTest();
1059
        $this->resetAfterTest();
1060
 
1060
 
1061
        $this->course = $this->getDataGenerator()->create_course();
1061
        $this->course = $this->getDataGenerator()->create_course();
Línea 1074... Línea 1074...
1074
    }
1074
    }
Línea 1075... Línea 1075...
1075
 
1075
 
1076
    /**
1076
    /**
1077
     * Test that users can or can not change Show Safe Exam Browser download button setting.
1077
     * Test that users can or can not change Show Safe Exam Browser download button setting.
1078
     */
1078
     */
1079
    public function test_can_change_seb_showsebdownloadlink() {
1079
    public function test_can_change_seb_showsebdownloadlink(): void {
Línea 1080... Línea 1080...
1080
        $this->resetAfterTest();
1080
        $this->resetAfterTest();
1081
 
1081
 
1082
        $this->course = $this->getDataGenerator()->create_course();
1082
        $this->course = $this->getDataGenerator()->create_course();
Línea 1094... Línea 1094...
1094
    }
1094
    }
Línea 1095... Línea 1095...
1095
 
1095
 
1096
    /**
1096
    /**
1097
     * Test that users can or can not change Allowed Browser Exam Keys setting.
1097
     * Test that users can or can not change Allowed Browser Exam Keys setting.
1098
     */
1098
     */
1099
    public function test_can_change_seb_allowedbrowserexamkeys() {
1099
    public function test_can_change_seb_allowedbrowserexamkeys(): void {
1100
        $this->resetAfterTest();
1100
        $this->resetAfterTest();
Línea 1101... Línea 1101...
1101
        $this->course = $this->getDataGenerator()->create_course();
1101
        $this->course = $this->getDataGenerator()->create_course();
1102
 
1102
 
Línea 1118... Línea 1118...
1118
     *
1118
     *
1119
     * @param string $settingcapability Setting capability to check manual option against.
1119
     * @param string $settingcapability Setting capability to check manual option against.
1120
     *
1120
     *
1121
     * @dataProvider settings_capability_data_provider
1121
     * @dataProvider settings_capability_data_provider
1122
     */
1122
     */
1123
    public function test_can_configure_manually($settingcapability) {
1123
    public function test_can_configure_manually($settingcapability): void {
1124
        $this->resetAfterTest();
1124
        $this->resetAfterTest();
1125
        $this->course = $this->getDataGenerator()->create_course();
1125
        $this->course = $this->getDataGenerator()->create_course();
Línea 1126... Línea 1126...
1126
 
1126
 
1127
        $this->quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $this->course->id]);
1127
        $this->quiz = $this->getDataGenerator()->create_module('quiz', ['course' => $this->course->id]);
Línea 1139... Línea 1139...
1139
    }
1139
    }
Línea 1140... Línea 1140...
1140
 
1140
 
1141
    /**
1141
    /**
1142
     * Test that we can check if the seb settings are locked.
1142
     * Test that we can check if the seb settings are locked.
1143
     */
1143
     */
1144
    public function test_is_seb_settings_locked() {
1144
    public function test_is_seb_settings_locked(): void {
Línea 1145... Línea 1145...
1145
        $this->resetAfterTest();
1145
        $this->resetAfterTest();
1146
 
1146
 
1147
        $this->course = $this->getDataGenerator()->create_course();
1147
        $this->course = $this->getDataGenerator()->create_course();
Línea 1155... Línea 1155...
1155
    }
1155
    }
Línea 1156... Línea 1156...
1156
 
1156
 
1157
    /**
1157
    /**
1158
     * Test that we can check identify conflicting permissions if set to use template.
1158
     * Test that we can check identify conflicting permissions if set to use template.
1159
     */
1159
     */
1160
    public function test_is_conflicting_permissions_for_manage_templates() {
1160
    public function test_is_conflicting_permissions_for_manage_templates(): void {
1161
        $this->resetAfterTest();
1161
        $this->resetAfterTest();
Línea 1162... Línea 1162...
1162
        $this->setAdminUser();
1162
        $this->setAdminUser();
1163
 
1163
 
Línea 1183... Línea 1183...
1183
    }
1183
    }
Línea 1184... Línea 1184...
1184
 
1184
 
1185
    /**
1185
    /**
1186
     * Test that we can check identify conflicting permissions if set to use own seb file.
1186
     * Test that we can check identify conflicting permissions if set to use own seb file.
1187
     */
1187
     */
1188
    public function test_is_conflicting_permissions_for_upload_seb_file() {
1188
    public function test_is_conflicting_permissions_for_upload_seb_file(): void {
1189
        $this->resetAfterTest();
1189
        $this->resetAfterTest();
Línea 1190... Línea 1190...
1190
        $this->setAdminUser();
1190
        $this->setAdminUser();
1191
 
1191
 
Línea 1214... Línea 1214...
1214
     *
1214
     *
1215
     * @param string $settingcapability Setting capability to check manual option against.
1215
     * @param string $settingcapability Setting capability to check manual option against.
1216
     *
1216
     *
1217
     * @dataProvider settings_capability_data_provider
1217
     * @dataProvider settings_capability_data_provider
1218
     */
1218
     */
1219
    public function test_is_conflicting_permissions_for_configure_manually($settingcapability) {
1219
    public function test_is_conflicting_permissions_for_configure_manually($settingcapability): void {
1220
        $this->resetAfterTest();
1220
        $this->resetAfterTest();
1221
        $this->setAdminUser();
1221
        $this->setAdminUser();
Línea 1222... Línea 1222...
1222
 
1222
 
1223
        $this->course = $this->getDataGenerator()->create_course();
1223
        $this->course = $this->getDataGenerator()->create_course();
Línea 1233... Línea 1233...
1233
    }
1233
    }
Línea 1234... Línea 1234...
1234
 
1234
 
1235
    /**
1235
    /**
1236
     * Test add_prefix helper method.
1236
     * Test add_prefix helper method.
1237
     */
1237
     */
1238
    public function test_add_prefix() {
1238
    public function test_add_prefix(): void {
1239
        $this->assertEquals('seb_one', settings_provider::add_prefix('one'));
1239
        $this->assertEquals('seb_one', settings_provider::add_prefix('one'));
1240
        $this->assertEquals('seb_two', settings_provider::add_prefix('seb_two'));
1240
        $this->assertEquals('seb_two', settings_provider::add_prefix('seb_two'));
1241
        $this->assertEquals('seb_seb_three', settings_provider::add_prefix('seb_seb_three'));
1241
        $this->assertEquals('seb_seb_three', settings_provider::add_prefix('seb_seb_three'));
1242
        $this->assertEquals('seb_', settings_provider::add_prefix('seb_'));
1242
        $this->assertEquals('seb_', settings_provider::add_prefix('seb_'));
Línea 1245... Línea 1245...
1245
    }
1245
    }
Línea 1246... Línea 1246...
1246
 
1246
 
1247
    /**
1247
    /**
1248
     * Test filter_plugin_settings helper method.
1248
     * Test filter_plugin_settings helper method.
1249
     */
1249
     */
1250
    public function test_filter_plugin_settings() {
1250
    public function test_filter_plugin_settings(): void {
1251
        $test = new \stdClass();
1251
        $test = new \stdClass();
1252
        $test->one = 'one';
1252
        $test->one = 'one';
1253
        $test->seb_two = 'two';
1253
        $test->seb_two = 'two';
1254
        $test->seb_seb_three = 'three';
1254
        $test->seb_seb_three = 'three';
Línea 1319... Línea 1319...
1319
    }
1319
    }
Línea 1320... Línea 1320...
1320
 
1320
 
1321
    /**
1321
    /**
1322
     * Test filter_plugin_settings method for no SEB case.
1322
     * Test filter_plugin_settings method for no SEB case.
1323
     */
1323
     */
1324
    public function test_filter_plugin_settings_for_no_seb() {
1324
    public function test_filter_plugin_settings_for_no_seb(): void {
1325
        $notnulls = ['requiresafeexambrowser'];
1325
        $notnulls = ['requiresafeexambrowser'];
1326
        $this->assert_filter_plugin_settings(settings_provider::USE_SEB_NO, $notnulls);
1326
        $this->assert_filter_plugin_settings(settings_provider::USE_SEB_NO, $notnulls);
Línea 1327... Línea 1327...
1327
    }
1327
    }
1328
 
1328
 
1329
    /**
1329
    /**
1330
     * Test filter_plugin_settings method for using uploaded config.
1330
     * Test filter_plugin_settings method for using uploaded config.
1331
     */
1331
     */
1332
    public function test_filter_plugin_settings_for_uploaded_config() {
1332
    public function test_filter_plugin_settings_for_uploaded_config(): void {
1333
        $notnulls = ['requiresafeexambrowser', 'showsebdownloadlink', 'allowedbrowserexamkeys'];
1333
        $notnulls = ['requiresafeexambrowser', 'showsebdownloadlink', 'allowedbrowserexamkeys'];
Línea 1334... Línea 1334...
1334
        $this->assert_filter_plugin_settings(settings_provider::USE_SEB_UPLOAD_CONFIG, $notnulls);
1334
        $this->assert_filter_plugin_settings(settings_provider::USE_SEB_UPLOAD_CONFIG, $notnulls);
1335
    }
1335
    }
1336
 
1336
 
1337
    /**
1337
    /**
1338
     * Test filter_plugin_settings method for using template.
1338
     * Test filter_plugin_settings method for using template.
1339
     */
1339
     */
1340
    public function test_filter_plugin_settings_for_template() {
1340
    public function test_filter_plugin_settings_for_template(): void {
Línea 1341... Línea 1341...
1341
        $notnulls = ['requiresafeexambrowser', 'showsebdownloadlink', 'allowuserquitseb', 'quitpassword', 'templateid'];
1341
        $notnulls = ['requiresafeexambrowser', 'showsebdownloadlink', 'allowuserquitseb', 'quitpassword', 'templateid'];
1342
        $this->assert_filter_plugin_settings(settings_provider::USE_SEB_TEMPLATE, $notnulls);
1342
        $this->assert_filter_plugin_settings(settings_provider::USE_SEB_TEMPLATE, $notnulls);
1343
    }
1343
    }
1344
 
1344
 
1345
    /**
1345
    /**
1346
     * Test filter_plugin_settings method for using client config.
1346
     * Test filter_plugin_settings method for using client config.
1347
     */
1347
     */
Línea 1348... Línea 1348...
1348
    public function test_filter_plugin_settings_for_client_config() {
1348
    public function test_filter_plugin_settings_for_client_config(): void {
1349
        $notnulls = ['requiresafeexambrowser', 'showsebdownloadlink', 'allowedbrowserexamkeys'];
1349
        $notnulls = ['requiresafeexambrowser', 'showsebdownloadlink', 'allowedbrowserexamkeys'];
1350
        $this->assert_filter_plugin_settings(settings_provider::USE_SEB_CLIENT_CONFIG, $notnulls);
1350
        $this->assert_filter_plugin_settings(settings_provider::USE_SEB_CLIENT_CONFIG, $notnulls);
1351
    }
1351
    }
1352
 
1352
 
1353
    /**
1353
    /**
1354
     * Test filter_plugin_settings method for manually configured SEB.
1354
     * Test filter_plugin_settings method for manually configured SEB.
Línea 1355... Línea 1355...
1355
     */
1355
     */
Línea 1372... Línea 1372...
1372
    }
1372
    }
Línea 1373... Línea 1373...
1373
 
1373
 
1374
    /**
1374
    /**
1375
     * Test settings map.
1375
     * Test settings map.
1376
     */
1376
     */
1377
    public function test_get_seb_settings_map() {
1377
    public function test_get_seb_settings_map(): void {
1378
        $expected = [
1378
        $expected = [
Línea 1379... Línea 1379...
1379
            settings_provider::USE_SEB_NO => [
1379
            settings_provider::USE_SEB_NO => [
1380
 
1380