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
    protected function prepare_quiz_data($ispreview = false) {
108
    protected function prepare_quiz_data($ispreview = false) {
109
        $quizobj = $this->prepare_quiz();
109
        $quizobj = $this->prepare_quiz();
110
        return $this->prepare_quiz_attempt($quizobj, $ispreview);
110
        return $this->prepare_quiz_attempt($quizobj, $ispreview);
111
    }
111
    }
Línea 112... Línea 112...
112
 
112
 
Línea 113... Línea 113...
113
    public function test_attempt_submitted() {
113
    public function test_attempt_submitted(): void {
114
 
114
 
Línea 115... Línea 115...
115
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
115
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
Línea 132... Línea 132...
132
        $this->assertEquals($attempt->userid, $event->relateduserid);
132
        $this->assertEquals($attempt->userid, $event->relateduserid);
133
        $this->assertEquals(null, $event->other['submitterid']); // Should be the user, but PHP Unit complains...
133
        $this->assertEquals(null, $event->other['submitterid']); // Should be the user, but PHP Unit complains...
134
        $this->assertEventContextNotUsed($event);
134
        $this->assertEventContextNotUsed($event);
135
    }
135
    }
Línea 136... Línea 136...
136
 
136
 
Línea 137... Línea 137...
137
    public function test_attempt_becameoverdue() {
137
    public function test_attempt_becameoverdue(): void {
138
 
138
 
Línea 139... Línea 139...
139
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
139
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
Línea 156... Línea 156...
156
        // Submitterid should be the user, but as we are in PHP Unit, CLI_SCRIPT is set to true which sets null in submitterid.
156
        // Submitterid should be the user, but as we are in PHP Unit, CLI_SCRIPT is set to true which sets null in submitterid.
157
        $this->assertEquals(null, $event->other['submitterid']);
157
        $this->assertEquals(null, $event->other['submitterid']);
158
        $this->assertEventContextNotUsed($event);
158
        $this->assertEventContextNotUsed($event);
159
    }
159
    }
Línea 160... Línea 160...
160
 
160
 
Línea 161... Línea 161...
161
    public function test_attempt_abandoned() {
161
    public function test_attempt_abandoned(): void {
162
 
162
 
Línea 163... Línea 163...
163
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
163
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
Línea 179... Línea 179...
179
        // Submitterid should be the user, but as we are in PHP Unit, CLI_SCRIPT is set to true which sets null in submitterid.
179
        // Submitterid should be the user, but as we are in PHP Unit, CLI_SCRIPT is set to true which sets null in submitterid.
180
        $this->assertEquals(null, $event->other['submitterid']);
180
        $this->assertEquals(null, $event->other['submitterid']);
181
        $this->assertEventContextNotUsed($event);
181
        $this->assertEventContextNotUsed($event);
182
    }
182
    }
Línea 183... Línea 183...
183
 
183
 
184
    public function test_attempt_started() {
184
    public function test_attempt_started(): void {
Línea 185... Línea 185...
185
        $quizobj = $this->prepare_quiz();
185
        $quizobj = $this->prepare_quiz();
186
 
186
 
Línea 210... Línea 210...
210
     * Test the attempt question restarted event.
210
     * Test the attempt question restarted event.
211
     *
211
     *
212
     * There is no external API for replacing a question, so the unit test will simply
212
     * There is no external API for replacing a question, so the unit test will simply
213
     * create and trigger the event and ensure the event data is returned as expected.
213
     * create and trigger the event and ensure the event data is returned as expected.
214
     */
214
     */
215
    public function test_attempt_question_restarted() {
215
    public function test_attempt_question_restarted(): void {
216
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
216
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
Línea 217... Línea 217...
217
 
217
 
218
        $params = [
218
        $params = [
219
            'objectid' => 1,
219
            'objectid' => 1,
Línea 245... Línea 245...
245
     * Test the attempt updated event.
245
     * Test the attempt updated event.
246
     *
246
     *
247
     * There is no external API for updating an attempt, so the unit test will simply
247
     * There is no external API for updating an attempt, so the unit test will simply
248
     * create and trigger the event and ensure the event data is returned as expected.
248
     * create and trigger the event and ensure the event data is returned as expected.
249
     */
249
     */
250
    public function test_attempt_updated() {
250
    public function test_attempt_updated(): void {
251
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
251
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
Línea 252... Línea 252...
252
 
252
 
253
        $params = [
253
        $params = [
254
            'objectid' => 1,
254
            'objectid' => 1,
Línea 278... Línea 278...
278
     * Test the attempt auto-saved event.
278
     * Test the attempt auto-saved event.
279
     *
279
     *
280
     * There is no external API for auto-saving an attempt, so the unit test will simply
280
     * There is no external API for auto-saving an attempt, so the unit test will simply
281
     * create and trigger the event and ensure the event data is returned as expected.
281
     * create and trigger the event and ensure the event data is returned as expected.
282
     */
282
     */
283
    public function test_attempt_autosaved() {
283
    public function test_attempt_autosaved(): void {
284
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
284
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
Línea 285... Línea 285...
285
 
285
 
286
        $params = [
286
        $params = [
287
            'objectid' => 1,
287
            'objectid' => 1,
Línea 312... Línea 312...
312
     * Test the edit page viewed event.
312
     * Test the edit page viewed event.
313
     *
313
     *
314
     * There is no external API for updating a quiz, so the unit test will simply
314
     * There is no external API for updating a quiz, so the unit test will simply
315
     * create and trigger the event and ensure the event data is returned as expected.
315
     * create and trigger the event and ensure the event data is returned as expected.
316
     */
316
     */
317
    public function test_edit_page_viewed() {
317
    public function test_edit_page_viewed(): void {
318
        $this->resetAfterTest();
318
        $this->resetAfterTest();
Línea 319... Línea 319...
319
 
319
 
320
        $this->setAdminUser();
320
        $this->setAdminUser();
321
        $course = $this->getDataGenerator()->create_course();
321
        $course = $this->getDataGenerator()->create_course();
Línea 343... Línea 343...
343
    }
343
    }
Línea 344... Línea 344...
344
 
344
 
345
    /**
345
    /**
346
     * Test the attempt deleted event.
346
     * Test the attempt deleted event.
347
     */
347
     */
348
    public function test_attempt_deleted() {
348
    public function test_attempt_deleted(): void {
Línea 349... Línea 349...
349
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
349
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
350
 
350
 
351
        // Trigger and capture the event.
351
        // Trigger and capture the event.
Línea 361... Línea 361...
361
    }
361
    }
Línea 362... Línea 362...
362
 
362
 
363
    /**
363
    /**
364
     * Test that preview attempt deletions are not logged.
364
     * Test that preview attempt deletions are not logged.
365
     */
365
     */
366
    public function test_preview_attempt_deleted() {
366
    public function test_preview_attempt_deleted(): void {
367
        // Create quiz with preview attempt.
367
        // Create quiz with preview attempt.
Línea 368... Línea 368...
368
        list($quizobj, $quba, $previewattempt) = $this->prepare_quiz_data(true);
368
        list($quizobj, $quba, $previewattempt) = $this->prepare_quiz_data(true);
369
 
369
 
Línea 379... Línea 379...
379
     * Test the report viewed event.
379
     * Test the report viewed event.
380
     *
380
     *
381
     * There is no external API for viewing reports, so the unit test will simply
381
     * There is no external API for viewing reports, so the unit test will simply
382
     * create and trigger the event and ensure the event data is returned as expected.
382
     * create and trigger the event and ensure the event data is returned as expected.
383
     */
383
     */
384
    public function test_report_viewed() {
384
    public function test_report_viewed(): void {
385
        $this->resetAfterTest();
385
        $this->resetAfterTest();
Línea 386... Línea 386...
386
 
386
 
387
        $this->setAdminUser();
387
        $this->setAdminUser();
388
        $course = $this->getDataGenerator()->create_course();
388
        $course = $this->getDataGenerator()->create_course();
Línea 413... Línea 413...
413
     * Test the attempt reviewed event.
413
     * Test the attempt reviewed event.
414
     *
414
     *
415
     * There is no external API for reviewing attempts, so the unit test will simply
415
     * There is no external API for reviewing attempts, so the unit test will simply
416
     * create and trigger the event and ensure the event data is returned as expected.
416
     * create and trigger the event and ensure the event data is returned as expected.
417
     */
417
     */
418
    public function test_attempt_reviewed() {
418
    public function test_attempt_reviewed(): void {
419
        $this->resetAfterTest();
419
        $this->resetAfterTest();
Línea 420... Línea 420...
420
 
420
 
421
        $this->setAdminUser();
421
        $this->setAdminUser();
422
        $course = $this->getDataGenerator()->create_course();
422
        $course = $this->getDataGenerator()->create_course();
Línea 449... Línea 449...
449
     * Test the attempt summary viewed event.
449
     * Test the attempt summary viewed event.
450
     *
450
     *
451
     * There is no external API for viewing the attempt summary, so the unit test will simply
451
     * There is no external API for viewing the attempt summary, so the unit test will simply
452
     * create and trigger the event and ensure the event data is returned as expected.
452
     * create and trigger the event and ensure the event data is returned as expected.
453
     */
453
     */
454
    public function test_attempt_summary_viewed() {
454
    public function test_attempt_summary_viewed(): void {
455
        $this->resetAfterTest();
455
        $this->resetAfterTest();
Línea 456... Línea 456...
456
 
456
 
457
        $this->setAdminUser();
457
        $this->setAdminUser();
458
        $course = $this->getDataGenerator()->create_course();
458
        $course = $this->getDataGenerator()->create_course();
Línea 485... Línea 485...
485
     * Test the user override created event.
485
     * Test the user override created event.
486
     *
486
     *
487
     * There is no external API for creating a user override, so the unit test will simply
487
     * There is no external API for creating a user override, so the unit test will simply
488
     * create and trigger the event and ensure the event data is returned as expected.
488
     * create and trigger the event and ensure the event data is returned as expected.
489
     */
489
     */
490
    public function test_user_override_created() {
490
    public function test_user_override_created(): void {
491
        $this->resetAfterTest();
491
        $this->resetAfterTest();
Línea 492... Línea 492...
492
 
492
 
493
        $this->setAdminUser();
493
        $this->setAdminUser();
494
        $course = $this->getDataGenerator()->create_course();
494
        $course = $this->getDataGenerator()->create_course();
Línea 520... Línea 520...
520
     * Test the group override created event.
520
     * Test the group override created event.
521
     *
521
     *
522
     * There is no external API for creating a group override, so the unit test will simply
522
     * There is no external API for creating a group override, so the unit test will simply
523
     * create and trigger the event and ensure the event data is returned as expected.
523
     * create and trigger the event and ensure the event data is returned as expected.
524
     */
524
     */
525
    public function test_group_override_created() {
525
    public function test_group_override_created(): void {
526
        $this->resetAfterTest();
526
        $this->resetAfterTest();
Línea 527... Línea 527...
527
 
527
 
528
        $this->setAdminUser();
528
        $this->setAdminUser();
529
        $course = $this->getDataGenerator()->create_course();
529
        $course = $this->getDataGenerator()->create_course();
Línea 555... Línea 555...
555
     * Test the user override updated event.
555
     * Test the user override updated event.
556
     *
556
     *
557
     * There is no external API for updating a user override, so the unit test will simply
557
     * There is no external API for updating a user override, so the unit test will simply
558
     * create and trigger the event and ensure the event data is returned as expected.
558
     * create and trigger the event and ensure the event data is returned as expected.
559
     */
559
     */
560
    public function test_user_override_updated() {
560
    public function test_user_override_updated(): void {
561
        $this->resetAfterTest();
561
        $this->resetAfterTest();
Línea 562... Línea 562...
562
 
562
 
563
        $this->setAdminUser();
563
        $this->setAdminUser();
564
        $course = $this->getDataGenerator()->create_course();
564
        $course = $this->getDataGenerator()->create_course();
Línea 590... Línea 590...
590
     * Test the group override updated event.
590
     * Test the group override updated event.
591
     *
591
     *
592
     * There is no external API for updating a group override, so the unit test will simply
592
     * There is no external API for updating a group override, so the unit test will simply
593
     * create and trigger the event and ensure the event data is returned as expected.
593
     * create and trigger the event and ensure the event data is returned as expected.
594
     */
594
     */
595
    public function test_group_override_updated() {
595
    public function test_group_override_updated(): void {
596
        $this->resetAfterTest();
596
        $this->resetAfterTest();
Línea 597... Línea 597...
597
 
597
 
598
        $this->setAdminUser();
598
        $this->setAdminUser();
599
        $course = $this->getDataGenerator()->create_course();
599
        $course = $this->getDataGenerator()->create_course();
Línea 622... Línea 622...
622
    }
622
    }
Línea 623... Línea 623...
623
 
623
 
624
    /**
624
    /**
625
     * Test the user override deleted event.
625
     * Test the user override deleted event.
626
     */
626
     */
627
    public function test_user_override_deleted() {
627
    public function test_user_override_deleted(): void {
Línea 628... Línea 628...
628
        global $DB;
628
        global $DB;
Línea 629... Línea 629...
629
 
629
 
Línea 653... Línea 653...
653
    }
653
    }
Línea 654... Línea 654...
654
 
654
 
655
    /**
655
    /**
656
     * Test the group override deleted event.
656
     * Test the group override deleted event.
657
     */
657
     */
658
    public function test_group_override_deleted() {
658
    public function test_group_override_deleted(): void {
Línea 659... Línea 659...
659
        global $DB;
659
        global $DB;
Línea 660... Línea 660...
660
 
660
 
Línea 687... Línea 687...
687
     * Test the attempt viewed event.
687
     * Test the attempt viewed event.
688
     *
688
     *
689
     * There is no external API for continuing an attempt, so the unit test will simply
689
     * There is no external API for continuing an attempt, so the unit test will simply
690
     * create and trigger the event and ensure the event data is returned as expected.
690
     * create and trigger the event and ensure the event data is returned as expected.
691
     */
691
     */
692
    public function test_attempt_viewed() {
692
    public function test_attempt_viewed(): void {
693
        $this->resetAfterTest();
693
        $this->resetAfterTest();
Línea 694... Línea 694...
694
 
694
 
695
        $this->setAdminUser();
695
        $this->setAdminUser();
696
        $course = $this->getDataGenerator()->create_course();
696
        $course = $this->getDataGenerator()->create_course();
Línea 721... Línea 721...
721
    }
721
    }
Línea 722... Línea 722...
722
 
722
 
723
    /**
723
    /**
724
     * Test the attempt previewed event.
724
     * Test the attempt previewed event.
725
     */
725
     */
726
    public function test_attempt_preview_started() {
726
    public function test_attempt_preview_started(): void {
Línea 727... Línea 727...
727
        $quizobj = $this->prepare_quiz();
727
        $quizobj = $this->prepare_quiz();
728
 
728
 
Línea 749... Línea 749...
749
     * Test the question manually graded event.
749
     * Test the question manually graded event.
750
     *
750
     *
751
     * There is no external API for manually grading a question, so the unit test will simply
751
     * There is no external API for manually grading a question, so the unit test will simply
752
     * create and trigger the event and ensure the event data is returned as expected.
752
     * create and trigger the event and ensure the event data is returned as expected.
753
     */
753
     */
754
    public function test_question_manually_graded() {
754
    public function test_question_manually_graded(): void {
755
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
755
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
Línea 756... Línea 756...
756
 
756
 
757
        $params = [
757
        $params = [
758
            'objectid' => 1,
758
            'objectid' => 1,
Línea 782... Línea 782...
782
     * Test the attempt regraded event.
782
     * Test the attempt regraded event.
783
     *
783
     *
784
     * There is no external API for regrading attempts, so the unit test will simply
784
     * There is no external API for regrading attempts, so the unit test will simply
785
     * create and trigger the event and ensure the event data is returned as expected.
785
     * create and trigger the event and ensure the event data is returned as expected.
786
     */
786
     */
787
    public function test_attempt_regraded() {
787
    public function test_attempt_regraded(): void {
788
        $this->resetAfterTest();
788
        $this->resetAfterTest();
Línea 789... Línea 789...
789
 
789
 
790
        $this->setAdminUser();
790
        $this->setAdminUser();
791
        $course = $this->getDataGenerator()->create_course();
791
        $course = $this->getDataGenerator()->create_course();
Línea 817... Línea 817...
817
    /**
817
    /**
818
     * Test the attempt notify manual graded event.
818
     * Test the attempt notify manual graded event.
819
     * There is no external API for notification email when manual grading of user's attempt is completed,
819
     * There is no external API for notification email when manual grading of user's attempt is completed,
820
     * so the unit test will simply create and trigger the event and ensure the event data is returned as expected.
820
     * so the unit test will simply create and trigger the event and ensure the event data is returned as expected.
821
     */
821
     */
822
    public function test_attempt_manual_grading_completed() {
822
    public function test_attempt_manual_grading_completed(): void {
823
        $this->resetAfterTest();
823
        $this->resetAfterTest();
824
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
824
        list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
825
        $attemptobj = quiz_attempt::create($attempt->id);
825
        $attemptobj = quiz_attempt::create($attempt->id);
Línea 826... Línea 826...
826
 
826
 
Línea 856... Línea 856...
856
     * Test the page break created event.
856
     * Test the page break created event.
857
     *
857
     *
858
     * There is no external API for creating page break, so the unit test will simply
858
     * There is no external API for creating page break, so the unit test will simply
859
     * create and trigger the event and ensure the event data is returned as expected.
859
     * create and trigger the event and ensure the event data is returned as expected.
860
     */
860
     */
861
    public function test_page_break_created() {
861
    public function test_page_break_created(): void {
862
        $quizobj = $this->prepare_quiz();
862
        $quizobj = $this->prepare_quiz();
Línea 863... Línea 863...
863
 
863
 
864
        $params = [
864
        $params = [
865
            'objectid' => 1,
865
            'objectid' => 1,
Línea 887... Línea 887...
887
     * Test the page break deleted event.
887
     * Test the page break deleted event.
888
     *
888
     *
889
     * There is no external API for deleting page break, so the unit test will simply
889
     * There is no external API for deleting page break, so the unit test will simply
890
     * create and trigger the event and ensure the event data is returned as expected.
890
     * create and trigger the event and ensure the event data is returned as expected.
891
     */
891
     */
892
    public function test_page_deleted_created() {
892
    public function test_page_deleted_created(): void {
893
        $quizobj = $this->prepare_quiz();
893
        $quizobj = $this->prepare_quiz();
Línea 894... Línea 894...
894
 
894
 
895
        $params = [
895
        $params = [
896
            'objectid' => 1,
896
            'objectid' => 1,
Línea 918... Línea 918...
918
     * Test the quiz grade updated event.
918
     * Test the quiz grade updated event.
919
     *
919
     *
920
     * There is no external API for updating quiz grade, so the unit test will simply
920
     * There is no external API for updating quiz grade, so the unit test will simply
921
     * create and trigger the event and ensure the event data is returned as expected.
921
     * create and trigger the event and ensure the event data is returned as expected.
922
     */
922
     */
923
    public function test_quiz_grade_updated() {
923
    public function test_quiz_grade_updated(): void {
924
        $quizobj = $this->prepare_quiz();
924
        $quizobj = $this->prepare_quiz();
Línea 925... Línea 925...
925
 
925
 
926
        $params = [
926
        $params = [
927
            'objectid' => $quizobj->get_quizid(),
927
            'objectid' => $quizobj->get_quizid(),
Línea 949... Línea 949...
949
     * Test the quiz re-paginated event.
949
     * Test the quiz re-paginated event.
950
     *
950
     *
951
     * There is no external API for re-paginating quiz, so the unit test will simply
951
     * There is no external API for re-paginating quiz, so the unit test will simply
952
     * create and trigger the event and ensure the event data is returned as expected.
952
     * create and trigger the event and ensure the event data is returned as expected.
953
     */
953
     */
954
    public function test_quiz_repaginated() {
954
    public function test_quiz_repaginated(): void {
955
        $quizobj = $this->prepare_quiz();
955
        $quizobj = $this->prepare_quiz();
Línea 956... Línea 956...
956
 
956
 
957
        $params = [
957
        $params = [
958
            'objectid' => $quizobj->get_quizid(),
958
            'objectid' => $quizobj->get_quizid(),
Línea 979... Línea 979...
979
     * Test the section break created event.
979
     * Test the section break created event.
980
     *
980
     *
981
     * There is no external API for creating section break, so the unit test will simply
981
     * There is no external API for creating section break, so the unit test will simply
982
     * create and trigger the event and ensure the event data is returned as expected.
982
     * create and trigger the event and ensure the event data is returned as expected.
983
     */
983
     */
984
    public function test_section_break_created() {
984
    public function test_section_break_created(): void {
985
        $quizobj = $this->prepare_quiz();
985
        $quizobj = $this->prepare_quiz();
Línea 986... Línea 986...
986
 
986
 
987
        $params = [
987
        $params = [
988
            'objectid' => 1,
988
            'objectid' => 1,
Línea 1013... Línea 1013...
1013
     * Test the section break deleted event.
1013
     * Test the section break deleted event.
1014
     *
1014
     *
1015
     * There is no external API for deleting section break, so the unit test will simply
1015
     * There is no external API for deleting section break, so the unit test will simply
1016
     * create and trigger the event and ensure the event data is returned as expected.
1016
     * create and trigger the event and ensure the event data is returned as expected.
1017
     */
1017
     */
1018
    public function test_section_break_deleted() {
1018
    public function test_section_break_deleted(): void {
1019
        $quizobj = $this->prepare_quiz();
1019
        $quizobj = $this->prepare_quiz();
Línea 1020... Línea 1020...
1020
 
1020
 
1021
        $params = [
1021
        $params = [
1022
            'objectid' => 1,
1022
            'objectid' => 1,
Línea 1045... Línea 1045...
1045
     * Test the section shuffle updated event.
1045
     * Test the section shuffle updated event.
1046
     *
1046
     *
1047
     * There is no external API for updating section shuffle, so the unit test will simply
1047
     * There is no external API for updating section shuffle, so the unit test will simply
1048
     * create and trigger the event and ensure the event data is returned as expected.
1048
     * create and trigger the event and ensure the event data is returned as expected.
1049
     */
1049
     */
1050
    public function test_section_shuffle_updated() {
1050
    public function test_section_shuffle_updated(): void {
1051
        $quizobj = $this->prepare_quiz();
1051
        $quizobj = $this->prepare_quiz();
Línea 1052... Línea 1052...
1052
 
1052
 
1053
        $params = [
1053
        $params = [
1054
            'objectid' => 1,
1054
            'objectid' => 1,
Línea 1077... Línea 1077...
1077
     * Test the section title updated event.
1077
     * Test the section title updated event.
1078
     *
1078
     *
1079
     * There is no external API for updating section title, so the unit test will simply
1079
     * There is no external API for updating section title, so the unit test will simply
1080
     * create and trigger the event and ensure the event data is returned as expected.
1080
     * create and trigger the event and ensure the event data is returned as expected.
1081
     */
1081
     */
1082
    public function test_section_title_updated() {
1082
    public function test_section_title_updated(): void {
1083
        $quizobj = $this->prepare_quiz();
1083
        $quizobj = $this->prepare_quiz();
Línea 1084... Línea 1084...
1084
 
1084
 
1085
        $params = [
1085
        $params = [
1086
            'objectid' => 1,
1086
            'objectid' => 1,
Línea 1111... Línea 1111...
1111
     * Test the slot created event.
1111
     * Test the slot created event.
1112
     *
1112
     *
1113
     * There is no external API for creating slot, so the unit test will simply
1113
     * There is no external API for creating slot, so the unit test will simply
1114
     * create and trigger the event and ensure the event data is returned as expected.
1114
     * create and trigger the event and ensure the event data is returned as expected.
1115
     */
1115
     */
1116
    public function test_slot_created() {
1116
    public function test_slot_created(): void {
1117
        $quizobj = $this->prepare_quiz();
1117
        $quizobj = $this->prepare_quiz();
Línea 1118... Línea 1118...
1118
 
1118
 
1119
        $params = [
1119
        $params = [
1120
            'objectid' => 1,
1120
            'objectid' => 1,
Línea 1143... Línea 1143...
1143
     * Test the slot deleted event.
1143
     * Test the slot deleted event.
1144
     *
1144
     *
1145
     * There is no external API for deleting slot, so the unit test will simply
1145
     * There is no external API for deleting slot, so the unit test will simply
1146
     * create and trigger the event and ensure the event data is returned as expected.
1146
     * create and trigger the event and ensure the event data is returned as expected.
1147
     */
1147
     */
1148
    public function test_slot_deleted() {
1148
    public function test_slot_deleted(): void {
1149
        $quizobj = $this->prepare_quiz();
1149
        $quizobj = $this->prepare_quiz();
Línea 1150... Línea 1150...
1150
 
1150
 
1151
        $params = [
1151
        $params = [
1152
            'objectid' => 1,
1152
            'objectid' => 1,
Línea 1174... Línea 1174...
1174
     * Test the slot mark updated event.
1174
     * Test the slot mark updated event.
1175
     *
1175
     *
1176
     * There is no external API for updating slot mark, so the unit test will simply
1176
     * There is no external API for updating slot mark, so the unit test will simply
1177
     * create and trigger the event and ensure the event data is returned as expected.
1177
     * create and trigger the event and ensure the event data is returned as expected.
1178
     */
1178
     */
1179
    public function test_slot_mark_updated() {
1179
    public function test_slot_mark_updated(): void {
1180
        $quizobj = $this->prepare_quiz();
1180
        $quizobj = $this->prepare_quiz();
Línea 1181... Línea 1181...
1181
 
1181
 
1182
        $params = [
1182
        $params = [
1183
            'objectid' => 1,
1183
            'objectid' => 1,
Línea 1344... Línea 1344...
1344
     * Test the slot moved event.
1344
     * Test the slot moved event.
1345
     *
1345
     *
1346
     * There is no external API for moving slot, so the unit test will simply
1346
     * There is no external API for moving slot, so the unit test will simply
1347
     * create and trigger the event and ensure the event data is returned as expected.
1347
     * create and trigger the event and ensure the event data is returned as expected.
1348
     */
1348
     */
1349
    public function test_slot_moved() {
1349
    public function test_slot_moved(): void {
1350
        $quizobj = $this->prepare_quiz();
1350
        $quizobj = $this->prepare_quiz();
Línea 1351... Línea 1351...
1351
 
1351
 
1352
        $params = [
1352
        $params = [
1353
            'objectid' => 1,
1353
            'objectid' => 1,
Línea 1377... Línea 1377...
1377
     * Test the slot require previous updated event.
1377
     * Test the slot require previous updated event.
1378
     *
1378
     *
1379
     * There is no external API for updating slot require previous option, so the unit test will simply
1379
     * There is no external API for updating slot require previous option, so the unit test will simply
1380
     * create and trigger the event and ensure the event data is returned as expected.
1380
     * create and trigger the event and ensure the event data is returned as expected.
1381
     */
1381
     */
1382
    public function test_slot_requireprevious_updated() {
1382
    public function test_slot_requireprevious_updated(): void {
1383
        $quizobj = $this->prepare_quiz();
1383
        $quizobj = $this->prepare_quiz();
Línea 1384... Línea 1384...
1384
 
1384
 
1385
        $params = [
1385
        $params = [
1386
            'objectid' => 1,
1386
            'objectid' => 1,