ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SettingsParticipantFunctionalityTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
25 #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithUsePreviousAnswerAllowedDataProvider')]
26 public function testGetAndWithUsePreviousAnswerAllowed(bool $io): void
27 {
28 $Settings_participant_functionality = (new SettingsParticipantFunctionality(0))->withUsePreviousAnswerAllowed($io);
29
30 $this->assertInstanceOf(SettingsParticipantFunctionality::class, $Settings_participant_functionality);
31 $this->assertEquals($io, $Settings_participant_functionality->getUsePreviousAnswerAllowed());
32 }
33
34 public static function getAndWithUsePreviousAnswerAllowedDataProvider(): array
35 {
36 return [
37 [true],
38 [false]
39 ];
40 }
41
42 #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithSuspendTestAllowedDataProvider')]
43 public function testGetAndWithSuspendTestAllowed(bool $io): void
44 {
45 $Settings_participant_functionality = (new SettingsParticipantFunctionality(0))->withSuspendTestAllowed($io);
46
47 $this->assertInstanceOf(SettingsParticipantFunctionality::class, $Settings_participant_functionality);
48 $this->assertEquals($io, $Settings_participant_functionality->getSuspendTestAllowed());
49 }
50
51 public static function getAndWithSuspendTestAllowedDataProvider(): array
52 {
53 return [
54 [true],
55 [false]
56 ];
57 }
58
59 #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithPostponedQuestionsMoveToEndDataProvider')]
60 public function testGetAndWithPostponedQuestionsMoveToEnd(bool $io): void
61 {
62 $Settings_participant_functionality = (new SettingsParticipantFunctionality(0))->withPostponedQuestionsMoveToEnd($io);
63
64 $this->assertInstanceOf(SettingsParticipantFunctionality::class, $Settings_participant_functionality);
65 $this->assertEquals($io, $Settings_participant_functionality->getPostponedQuestionsMoveToEnd());
66 }
67
69 {
70 return [
71 [true],
72 [false]
73 ];
74 }
75
76 #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithQuestionListEnabledDataProvider')]
77 public function testGetAndWithQuestionListEnabled(bool $io): void
78 {
79 $Settings_participant_functionality = (new SettingsParticipantFunctionality(0))->withQuestionListEnabled($io);
80
81 $this->assertInstanceOf(SettingsParticipantFunctionality::class, $Settings_participant_functionality);
82 $this->assertEquals($io, $Settings_participant_functionality->getQuestionListEnabled());
83 }
84
85 public static function getAndWithQuestionListEnabledDataProvider(): array
86 {
87 return [
88 [true],
89 [false]
90 ];
91 }
92
93 #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithUsrPassOverviewModeDataProvider')]
94 public function testGetAndWithUsrPassOverviewMode(int $io): void
95 {
96 $Settings_participant_functionality = (new SettingsParticipantFunctionality(0))->withUsrPassOverviewMode($io);
97
98 $this->assertInstanceOf(SettingsParticipantFunctionality::class, $Settings_participant_functionality);
99 $this->assertEquals($io, $Settings_participant_functionality->getUsrPassOverviewMode());
100 }
101
102 public static function getAndWithUsrPassOverviewModeDataProvider(): array
103 {
104 return [
105 [-1],
106 [0],
107 [1]
108 ];
109 }
110
111 #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithUsrPassOverviewEnabledDataProvider')]
112 public function testGetAndWithQuestionMarkingEnabled(bool $io): void
113 {
114 $Settings_participant_functionality = (new SettingsParticipantFunctionality(0));
115 $Settings_participant_functionality = $Settings_participant_functionality->withQuestionMarkingEnabled($io);
116
117 $this->assertInstanceOf(SettingsParticipantFunctionality::class, $Settings_participant_functionality);
118 $this->assertEquals($io, $Settings_participant_functionality->getQuestionMarkingEnabled());
119 }
120
121 public static function getAndWithUsrPassOverviewEnabledDataProvider(): array
122 {
123 return [
124 [true],
125 [false]
126 ];
127 }
128}
Class ilTestBaseClass.