Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 120... Línea 120...
120
     * @param string $setting
120
     * @param string $setting
121
     * @param string $data
121
     * @param string $data
122
     *
122
     *
123
     * @dataProvider valid_form_data_provider
123
     * @dataProvider valid_form_data_provider
124
     */
124
     */
125
    public function test_validate_settings_with_valid_data(string $setting, string $data) {
125
    public function test_validate_settings_with_valid_data(string $setting, string $data): void {
126
        $this->setAdminUser();
126
        $this->setAdminUser();
127
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
127
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
Línea 128... Línea 128...
128
 
128
 
129
        $form = $this->createMock('mod_quiz_mod_form');
129
        $form = $this->createMock('mod_quiz_mod_form');
Línea 144... Línea 144...
144
     * @param string $setting
144
     * @param string $setting
145
     * @param string $data
145
     * @param string $data
146
     *
146
     *
147
     * @dataProvider invalid_form_data_provider
147
     * @dataProvider invalid_form_data_provider
148
     */
148
     */
149
    public function test_validate_settings_with_invalid_data(string $setting, string $data) {
149
    public function test_validate_settings_with_invalid_data(string $setting, string $data): void {
150
        $this->setAdminUser();
150
        $this->setAdminUser();
Línea 151... Línea 151...
151
 
151
 
152
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
152
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
153
        $form = $this->createMock('mod_quiz_mod_form');
153
        $form = $this->createMock('mod_quiz_mod_form');
Línea 163... Línea 163...
163
    }
163
    }
Línea 164... Línea 164...
164
 
164
 
165
    /**
165
    /**
166
     * Test settings validation is not run if settings are locked.
166
     * Test settings validation is not run if settings are locked.
167
     */
167
     */
168
    public function test_settings_validation_is_not_run_if_settings_are_locked() {
168
    public function test_settings_validation_is_not_run_if_settings_are_locked(): void {
169
        $user = $this->getDataGenerator()->create_user();
169
        $user = $this->getDataGenerator()->create_user();
170
        $this->quiz = $this->create_test_quiz($this->course);
170
        $this->quiz = $this->create_test_quiz($this->course);
Línea 171... Línea 171...
171
        $this->attempt_quiz($this->quiz, $user);
171
        $this->attempt_quiz($this->quiz, $user);
Línea 184... Línea 184...
184
    }
184
    }
Línea 185... Línea 185...
185
 
185
 
186
    /**
186
    /**
187
     * Test settings validation is not run if settings are conflicting.
187
     * Test settings validation is not run if settings are conflicting.
188
     */
188
     */
189
    public function test_settings_validation_is_not_run_if_conflicting_permissions() {
189
    public function test_settings_validation_is_not_run_if_conflicting_permissions(): void {
190
        $this->setAdminUser();
190
        $this->setAdminUser();
Línea 191... Línea 191...
191
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
191
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
192
 
192
 
Línea 212... Línea 212...
212
    }
212
    }
Línea 213... Línea 213...
213
 
213
 
214
    /**
214
    /**
215
     * Test bypassing validation if user don't have permissions to manage seb settings.
215
     * Test bypassing validation if user don't have permissions to manage seb settings.
216
     */
216
     */
217
    public function test_validate_settings_is_not_run_if_a_user_do_not_have_permissions_to_manage_seb_settings() {
217
    public function test_validate_settings_is_not_run_if_a_user_do_not_have_permissions_to_manage_seb_settings(): void {
218
        // Set the user who can't change seb settings. So validation should be bypassed.
218
        // Set the user who can't change seb settings. So validation should be bypassed.
219
        $user = $this->getDataGenerator()->create_user();
219
        $user = $this->getDataGenerator()->create_user();
Línea 220... Línea 220...
220
        $this->setUser($user);
220
        $this->setUser($user);
Línea 232... Línea 232...
232
    }
232
    }
Línea 233... Línea 233...
233
 
233
 
234
    /**
234
    /**
235
     * Test settings are saved to DB.
235
     * Test settings are saved to DB.
236
     */
236
     */
237
    public function test_create_settings_with_existing_quiz() {
237
    public function test_create_settings_with_existing_quiz(): void {
Línea 238... Línea 238...
238
        global $DB;
238
        global $DB;
Línea 239... Línea 239...
239
 
239
 
Línea 248... Línea 248...
248
    }
248
    }
Línea 249... Línea 249...
249
 
249
 
250
    /**
250
    /**
251
     * Test settings are not saved to DB if settings are locked.
251
     * Test settings are not saved to DB if settings are locked.
252
     */
252
     */
253
    public function test_settings_are_not_saved_if_settings_are_locked() {
253
    public function test_settings_are_not_saved_if_settings_are_locked(): void {
Línea 254... Línea 254...
254
        global $DB;
254
        global $DB;
255
 
255
 
Línea 267... Línea 267...
267
    }
267
    }
Línea 268... Línea 268...
268
 
268
 
269
    /**
269
    /**
270
     * Test settings are not saved to DB if conflicting permissions.
270
     * Test settings are not saved to DB if conflicting permissions.
271
     */
271
     */
272
    public function test_settings_are_not_saved_if_conflicting_permissions() {
272
    public function test_settings_are_not_saved_if_conflicting_permissions(): void {
273
        $this->setAdminUser();
273
        $this->setAdminUser();
Línea 274... Línea 274...
274
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
274
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
275
 
275
 
Línea 290... Línea 290...
290
    }
290
    }
Línea 291... Línea 291...
291
 
291
 
292
    /**
292
    /**
293
     * Test exception thrown if cm could not be found while saving settings.
293
     * Test exception thrown if cm could not be found while saving settings.
294
     */
294
     */
295
    public function test_save_settings_throw_an_exception_if_cm_not_found() {
295
    public function test_save_settings_throw_an_exception_if_cm_not_found(): void {
Línea 296... Línea 296...
296
        global $DB;
296
        global $DB;
297
 
297
 
Línea 307... Línea 307...
307
    }
307
    }
Línea 308... Línea 308...
308
 
308
 
309
    /**
309
    /**
310
     * Test nothing happens when deleted is called without settings saved.
310
     * Test nothing happens when deleted is called without settings saved.
311
     */
311
     */
312
    public function test_delete_settings_without_existing_settings() {
312
    public function test_delete_settings_without_existing_settings(): void {
313
        global $DB;
313
        global $DB;
Línea 314... Línea 314...
314
        $this->setAdminUser();
314
        $this->setAdminUser();
315
 
315
 
Línea 320... Línea 320...
320
    }
320
    }
Línea 321... Línea 321...
321
 
321
 
322
    /**
322
    /**
323
     * Test settings are deleted from DB.
323
     * Test settings are deleted from DB.
324
     */
324
     */
325
    public function test_delete_settings_with_existing_settings() {
325
    public function test_delete_settings_with_existing_settings(): void {
326
        global $DB;
326
        global $DB;
Línea 327... Línea 327...
327
        $this->setAdminUser();
327
        $this->setAdminUser();
Línea 360... Línea 360...
360
    }
360
    }
Línea 361... Línea 361...
361
 
361
 
362
    /**
362
    /**
363
     * Test access prevented if config key is invalid.
363
     * Test access prevented if config key is invalid.
364
     */
364
     */
365
    public function test_access_prevented_if_config_key_invalid() {
365
    public function test_access_prevented_if_config_key_invalid(): void {
Línea 366... Línea 366...
366
        global $FULLME;
366
        global $FULLME;
367
 
367
 
Línea 379... Línea 379...
379
    }
379
    }
Línea 380... Línea 380...
380
 
380
 
381
    /**
381
    /**
382
     * Test access prevented if config keys is invalid and using uploaded config.
382
     * Test access prevented if config keys is invalid and using uploaded config.
383
     */
383
     */
384
    public function test_access_prevented_if_config_key_invalid_uploaded_config() {
384
    public function test_access_prevented_if_config_key_invalid_uploaded_config(): void {
Línea 385... Línea 385...
385
        global $FULLME;
385
        global $FULLME;
386
 
386
 
Línea 405... Línea 405...
405
    }
405
    }
Línea 406... Línea 406...
406
 
406
 
407
    /**
407
    /**
408
     * Test access prevented if config keys is invalid and using template.
408
     * Test access prevented if config keys is invalid and using template.
409
     */
409
     */
410
    public function test_access_prevented_if_config_key_invalid_uploaded_template() {
410
    public function test_access_prevented_if_config_key_invalid_uploaded_template(): void {
Línea 411... Línea 411...
411
        global $FULLME;
411
        global $FULLME;
412
 
412
 
Línea 430... Línea 430...
430
    }
430
    }
Línea 431... Línea 431...
431
 
431
 
432
    /**
432
    /**
433
     * Test access not prevented if config key matches header.
433
     * Test access not prevented if config key matches header.
434
     */
434
     */
435
    public function test_access_allowed_if_config_key_valid() {
435
    public function test_access_allowed_if_config_key_valid(): void {
Línea 436... Línea 436...
436
        global $FULLME;
436
        global $FULLME;
437
 
437
 
Línea 454... Línea 454...
454
    }
454
    }
Línea 455... Línea 455...
455
 
455
 
456
    /**
456
    /**
457
     * Test access not prevented if config key matches header.
457
     * Test access not prevented if config key matches header.
458
     */
458
     */
459
    public function test_access_allowed_if_config_key_valid_uploaded_config() {
459
    public function test_access_allowed_if_config_key_valid_uploaded_config(): void {
Línea 460... Línea 460...
460
        global $FULLME;
460
        global $FULLME;
461
 
461
 
Línea 481... Línea 481...
481
    }
481
    }
Línea 482... Línea 482...
482
 
482
 
483
    /**
483
    /**
484
     * Test access not prevented if config key matches header.
484
     * Test access not prevented if config key matches header.
485
     */
485
     */
486
    public function test_access_allowed_if_config_key_valid_template() {
486
    public function test_access_allowed_if_config_key_valid_template(): void {
Línea 487... Línea 487...
487
        global $FULLME;
487
        global $FULLME;
488
 
488
 
Línea 509... Línea 509...
509
    }
509
    }
Línea 510... Línea 510...
510
 
510
 
511
    /**
511
    /**
512
     * Test access not prevented if browser exam keys match headers.
512
     * Test access not prevented if browser exam keys match headers.
513
     */
513
     */
514
    public function test_access_allowed_if_browser_exam_keys_valid() {
514
    public function test_access_allowed_if_browser_exam_keys_valid(): void {
Línea 515... Línea 515...
515
        global $FULLME;
515
        global $FULLME;
516
 
516
 
Línea 538... Línea 538...
538
    }
538
    }
Línea 539... Línea 539...
539
 
539
 
540
    /**
540
    /**
541
     * Test access not prevented if browser exam keys match headers.
541
     * Test access not prevented if browser exam keys match headers.
542
     */
542
     */
543
    public function test_access_allowed_if_browser_exam_keys_valid_use_uploaded_file() {
543
    public function test_access_allowed_if_browser_exam_keys_valid_use_uploaded_file(): void {
Línea 544... Línea 544...
544
        global $FULLME;
544
        global $FULLME;
545
 
545
 
Línea 567... Línea 567...
567
 
567
 
568
        // Check that correct error message is returned.
568
        // Check that correct error message is returned.
569
        $this->assertFalse($this->make_rule()->prevent_access());
569
        $this->assertFalse($this->make_rule()->prevent_access());
Línea 570... Línea 570...
570
    }
570
    }
571
 
571
 
Línea 572... Línea 572...
572
    public function test_access_allowed_if_access_state_stored_in_session() {
572
    public function test_access_allowed_if_access_state_stored_in_session(): void {
573
        global $SESSION;
573
        global $SESSION;
Línea 632... Línea 632...
632
    }
632
    }
Línea 633... Línea 633...
633
 
633
 
634
    /**
634
    /**
635
     * Test access prevented if browser exam keys do not match headers.
635
     * Test access prevented if browser exam keys do not match headers.
636
     */
636
     */
637
    public function test_access_prevented_if_browser_exam_keys_are_invalid() {
637
    public function test_access_prevented_if_browser_exam_keys_are_invalid(): void {
638
        $this->setAdminUser();
638
        $this->setAdminUser();
Línea 639... Línea 639...
639
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
639
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
640
 
640
 
Línea 656... Línea 656...
656
    }
656
    }
Línea 657... Línea 657...
657
 
657
 
658
    /**
658
    /**
659
     * Test access prevented if browser exam keys do not match headers and using uploaded config.
659
     * Test access prevented if browser exam keys do not match headers and using uploaded config.
660
     */
660
     */
661
    public function test_access_prevented_if_browser_exam_keys_are_invalid_use_uploaded_file() {
661
    public function test_access_prevented_if_browser_exam_keys_are_invalid_use_uploaded_file(): void {
Línea 662... Línea 662...
662
        global $FULLME;
662
        global $FULLME;
663
 
663
 
Línea 688... Línea 688...
688
    }
688
    }
Línea 689... Línea 689...
689
 
689
 
690
    /**
690
    /**
691
     * Test access not prevented if browser exam keys do not match headers and using template.
691
     * Test access not prevented if browser exam keys do not match headers and using template.
692
     */
692
     */
693
    public function test_access_prevented_if_browser_exam_keys_are_invalid_use_template() {
693
    public function test_access_prevented_if_browser_exam_keys_are_invalid_use_template(): void {
Línea 694... Línea 694...
694
        global $FULLME;
694
        global $FULLME;
695
 
695
 
Línea 720... Línea 720...
720
    }
720
    }
Línea 721... Línea 721...
721
 
721
 
722
    /**
722
    /**
723
     * Test access allowed if using client configuration and SEB user agent header is valid.
723
     * Test access allowed if using client configuration and SEB user agent header is valid.
724
     */
724
     */
725
    public function test_access_allowed_if_using_client_config_basic_header_is_valid() {
725
    public function test_access_allowed_if_using_client_config_basic_header_is_valid(): void {
726
        $this->setAdminUser();
726
        $this->setAdminUser();
Línea 727... Línea 727...
727
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
727
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
728
 
728
 
Línea 742... Línea 742...
742
    }
742
    }
Línea 743... Línea 743...
743
 
743
 
744
    /**
744
    /**
745
     * Test access prevented if using client configuration and SEB user agent header is invalid.
745
     * Test access prevented if using client configuration and SEB user agent header is invalid.
746
     */
746
     */
747
    public function test_access_prevented_if_using_client_configuration_and_basic_head_is_invalid() {
747
    public function test_access_prevented_if_using_client_configuration_and_basic_head_is_invalid(): void {
748
        $this->setAdminUser();
748
        $this->setAdminUser();
Línea 749... Línea 749...
749
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
749
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
750
 
750
 
Línea 786... Línea 786...
786
    }
786
    }
Línea 787... Línea 787...
787
 
787
 
788
    /**
788
    /**
789
     * Test access allowed if using client configuration and SEB user agent header is invalid and use uploaded file.
789
     * Test access allowed if using client configuration and SEB user agent header is invalid and use uploaded file.
790
     */
790
     */
791
    public function test_access_allowed_if_using_client_configuration_and_basic_head_is_invalid_use_uploaded_config() {
791
    public function test_access_allowed_if_using_client_configuration_and_basic_head_is_invalid_use_uploaded_config(): void {
Línea 792... Línea 792...
792
        global $FULLME;
792
        global $FULLME;
793
 
793
 
Línea 815... Línea 815...
815
    }
815
    }
Línea 816... Línea 816...
816
 
816
 
817
    /**
817
    /**
818
     * Test access allowed if using client configuration and SEB user agent header is invalid and use template.
818
     * Test access allowed if using client configuration and SEB user agent header is invalid and use template.
819
     */
819
     */
820
    public function test_access_allowed_if_using_client_configuration_and_basic_head_is_invalid_use_template() {
820
    public function test_access_allowed_if_using_client_configuration_and_basic_head_is_invalid_use_template(): void {
Línea 821... Línea 821...
821
        global $FULLME;
821
        global $FULLME;
822
 
822
 
Línea 843... Línea 843...
843
    }
843
    }
Línea 844... Línea 844...
844
 
844
 
845
    /**
845
    /**
846
     * Test access not prevented if SEB not required.
846
     * Test access not prevented if SEB not required.
847
     */
847
     */
848
    public function test_access_allowed_if_seb_not_required() {
848
    public function test_access_allowed_if_seb_not_required(): void {
849
        $this->setAdminUser();
849
        $this->setAdminUser();
Línea 850... Línea 850...
850
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
850
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
851
 
851
 
Línea 862... Línea 862...
862
    }
862
    }
Línea 863... Línea 863...
863
 
863
 
864
    /**
864
    /**
865
     * Test access not prevented if USER has bypass capability.
865
     * Test access not prevented if USER has bypass capability.
866
     */
866
     */
867
    public function test_access_allowed_if_user_has_bypass_capability() {
867
    public function test_access_allowed_if_user_has_bypass_capability(): void {
868
        $this->setAdminUser();
868
        $this->setAdminUser();
Línea 869... Línea 869...
869
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
869
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
870
 
870
 
Línea 879... Línea 879...
879
    }
879
    }
Línea 880... Línea 880...
880
 
880
 
881
    /**
881
    /**
882
     * Test that quiz form cannot be saved if using template, but not actually pick one.
882
     * Test that quiz form cannot be saved if using template, but not actually pick one.
883
     */
883
     */
884
    public function test_mod_quiz_form_cannot_be_saved_using_template_and_template_is_not_set() {
884
    public function test_mod_quiz_form_cannot_be_saved_using_template_and_template_is_not_set(): void {
885
        $this->setAdminUser();
885
        $this->setAdminUser();
Línea 886... Línea 886...
886
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
886
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
887
 
887
 
Línea 899... Línea 899...
899
    }
899
    }
Línea 900... Línea 900...
900
 
900
 
901
    /**
901
    /**
902
     * Test that quiz form cannot be saved if uploaded invalid file.
902
     * Test that quiz form cannot be saved if uploaded invalid file.
903
     */
903
     */
904
    public function test_mod_quiz_form_cannot_be_saved_using_uploaded_file_and_file_is_not_valid() {
904
    public function test_mod_quiz_form_cannot_be_saved_using_uploaded_file_and_file_is_not_valid(): void {
905
        $this->setAdminUser();
905
        $this->setAdminUser();
Línea 906... Línea 906...
906
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
906
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
907
 
907
 
Línea 920... Línea 920...
920
    }
920
    }
Línea 921... Línea 921...
921
 
921
 
922
    /**
922
    /**
923
     * Test that quiz form cannot be saved if the global settings are set to require a password and no password is set.
923
     * Test that quiz form cannot be saved if the global settings are set to require a password and no password is set.
924
     */
924
     */
925
    public function test_mod_quiz_form_cannot_be_saved_if_global_settings_force_quiz_password_and_none_is_set() {
925
    public function test_mod_quiz_form_cannot_be_saved_if_global_settings_force_quiz_password_and_none_is_set(): void {
926
        $this->setAdminUser();
926
        $this->setAdminUser();
927
        // Set global settings to require quiz password but set password to be empty.
927
        // Set global settings to require quiz password but set password to be empty.
928
        set_config('quizpasswordrequired', '1', 'quizaccess_seb');
928
        set_config('quizpasswordrequired', '1', 'quizaccess_seb');
Línea 943... Línea 943...
943
 
943
 
944
    /**
944
    /**
945
     * Test that access to quiz is allowed if global setting is set to restrict quiz if no quiz password is set, and global quiz
945
     * Test that access to quiz is allowed if global setting is set to restrict quiz if no quiz password is set, and global quiz
946
     * password is set.
946
     * password is set.
947
     */
947
     */
948
    public function test_mod_quiz_form_can_be_saved_if_global_settings_force_quiz_password_and_is_set() {
948
    public function test_mod_quiz_form_can_be_saved_if_global_settings_force_quiz_password_and_is_set(): void {
949
        $this->setAdminUser();
949
        $this->setAdminUser();
950
        // Set global settings to require quiz password but set password to be empty.
950
        // Set global settings to require quiz password but set password to be empty.
Línea 951... Línea 951...
951
        set_config('quizpasswordrequired', '1', 'quizaccess_seb');
951
        set_config('quizpasswordrequired', '1', 'quizaccess_seb');
Línea 966... Línea 966...
966
    }
966
    }
Línea 967... Línea 967...
967
 
967
 
968
    /**
968
    /**
969
     * Test that quiz form can be saved if the global settings are set to require a password and no seb usage selected.
969
     * Test that quiz form can be saved if the global settings are set to require a password and no seb usage selected.
970
     */
970
     */
971
    public function test_mod_quiz_form_can_be_saved_if_global_settings_force_quiz_password_and_none_no_seb() {
971
    public function test_mod_quiz_form_can_be_saved_if_global_settings_force_quiz_password_and_none_no_seb(): void {
972
        $this->setAdminUser();
972
        $this->setAdminUser();
973
        // Set global settings to require quiz password but set password to be empty.
973
        // Set global settings to require quiz password but set password to be empty.
974
        set_config('quizpasswordrequired', '1', 'quizaccess_seb');
974
        set_config('quizpasswordrequired', '1', 'quizaccess_seb');
Línea 988... Línea 988...
988
    }
988
    }
Línea 989... Línea 989...
989
 
989
 
990
    /**
990
    /**
991
     * Test get_download_seb_button, checks for empty config setting quizaccess_seb/downloadlink.
991
     * Test get_download_seb_button, checks for empty config setting quizaccess_seb/downloadlink.
992
     */
992
     */
993
    public function test_get_download_seb_button() {
993
    public function test_get_download_seb_button(): void {
994
        $this->setAdminUser();
994
        $this->setAdminUser();
Línea 995... Línea 995...
995
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
995
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
996
 
996
 
Línea 1010... Línea 1010...
1010
    }
1010
    }
Línea 1011... Línea 1011...
1011
 
1011
 
1012
    /**
1012
    /**
1013
     * Test get_download_seb_button shows download SEB link when required,
1013
     * Test get_download_seb_button shows download SEB link when required,
1014
     */
1014
     */
1015
    public function test_get_get_action_buttons_shows_download_seb_link() {
1015
    public function test_get_get_action_buttons_shows_download_seb_link(): void {
1016
        $this->setAdminUser();
1016
        $this->setAdminUser();
Línea 1017... Línea 1017...
1017
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
1017
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
1018
 
1018
 
Línea 1029... Línea 1029...
1029
    }
1029
    }
Línea 1030... Línea 1030...
1030
 
1030
 
1031
    /**
1031
    /**
1032
     * Test get_download_seb_button shows SEB config related links when required.
1032
     * Test get_download_seb_button shows SEB config related links when required.
1033
     */
1033
     */
1034
    public function test_get_get_action_buttons_shows_launch_and_download_config_links() {
1034
    public function test_get_get_action_buttons_shows_launch_and_download_config_links(): void {
1035
        $this->setAdminUser();
1035
        $this->setAdminUser();
Línea 1036... Línea 1036...
1036
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
1036
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
1037
 
1037
 
Línea 1070... Línea 1070...
1070
    }
1070
    }
Línea 1071... Línea 1071...
1071
 
1071
 
1072
    /**
1072
    /**
1073
     * Test get_download_seb_button shows SEB config related links as configured in "showseblinks".
1073
     * Test get_download_seb_button shows SEB config related links as configured in "showseblinks".
1074
     */
1074
     */
1075
    public function test_get_get_action_buttons_shows_launch_and_download_config_links_as_configured() {
1075
    public function test_get_get_action_buttons_shows_launch_and_download_config_links_as_configured(): void {
1076
        $this->setAdminUser();
1076
        $this->setAdminUser();
Línea 1077... Línea 1077...
1077
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
1077
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
1078
 
1078
 
Línea 1100... Línea 1100...
1100
    }
1100
    }
Línea 1101... Línea 1101...
1101
 
1101
 
1102
    /**
1102
    /**
1103
     * Test get_quit_button. If attempt count is greater than 0
1103
     * Test get_quit_button. If attempt count is greater than 0
1104
     */
1104
     */
1105
    public function test_get_quit_button() {
1105
    public function test_get_quit_button(): void {
1106
        $this->setAdminUser();
1106
        $this->setAdminUser();
1107
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CLIENT_CONFIG);
1107
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CLIENT_CONFIG);
Línea 1108... Línea 1108...
1108
        $this->quiz->seb_linkquitseb = "http://test.quit.link";
1108
        $this->quiz->seb_linkquitseb = "http://test.quit.link";
Línea 1120... Línea 1120...
1120
    }
1120
    }
Línea 1121... Línea 1121...
1121
 
1121
 
1122
    /**
1122
    /**
1123
     * Test description, checks for a valid SEB session and attempt count .
1123
     * Test description, checks for a valid SEB session and attempt count .
1124
     */
1124
     */
1125
    public function test_description() {
1125
    public function test_description(): void {
1126
        $this->setAdminUser();
1126
        $this->setAdminUser();
Línea 1127... Línea 1127...
1127
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CLIENT_CONFIG);
1127
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CLIENT_CONFIG);
Línea 1150... Línea 1150...
1150
    }
1150
    }
Línea 1151... Línea 1151...
1151
 
1151
 
1152
    /**
1152
    /**
1153
     * Test description displays download SEB config button when required.
1153
     * Test description displays download SEB config button when required.
1154
     */
1154
     */
1155
    public function test_description_shows_download_config_link_when_required() {
1155
    public function test_description_shows_download_config_link_when_required(): void {
1156
        $this->setAdminUser();
1156
        $this->setAdminUser();
Línea 1157... Línea 1157...
1157
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
1157
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
Línea 1186... Línea 1186...
1186
    }
1186
    }
Línea 1187... Línea 1187...
1187
 
1187
 
1188
    /**
1188
    /**
1189
     * Test block display before a quiz started.
1189
     * Test block display before a quiz started.
1190
     */
1190
     */
1191
    public function test_blocks_display_before_attempt_started() {
1191
    public function test_blocks_display_before_attempt_started(): void {
Línea 1192... Línea 1192...
1192
        global $PAGE;
1192
        global $PAGE;
1193
 
1193
 
Línea 1219... Línea 1219...
1219
    }
1219
    }
Línea 1220... Línea 1220...
1220
 
1220
 
1221
    /**
1221
    /**
1222
     * Test block display after a quiz completed.
1222
     * Test block display after a quiz completed.
1223
     */
1223
     */
1224
    public function test_blocks_display_after_attempt_finished() {
1224
    public function test_blocks_display_after_attempt_finished(): void {
Línea 1225... Línea 1225...
1225
        global $PAGE;
1225
        global $PAGE;
1226
 
1226
 
Línea 1254... Línea 1254...
1254
    }
1254
    }
Línea 1255... Línea 1255...
1255
 
1255
 
1256
    /**
1256
    /**
1257
     * Test cleanup when quiz is completed.
1257
     * Test cleanup when quiz is completed.
1258
     */
1258
     */
1259
    public function test_current_attempt_finished() {
1259
    public function test_current_attempt_finished(): void {
1260
        global $SESSION;
1260
        global $SESSION;
Línea 1261... Línea 1261...
1261
        $this->setAdminUser();
1261
        $this->setAdminUser();
1262
 
1262