ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
SettingsQuestionBehaviourTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
26  {
27  return new SettingsQuestionBehaviour(
28  0,
29  0,
30  true,
31  0,
32  true,
33  true,
34  true,
35  true,
36  true,
37  true,
38  true,
39  true,
40  true,
41  true
42  );
43  }
44 
45  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithQuestionTitleOutputModeDataProvider')]
46  public function testGetAndWithQuestionTitleOutputMode(int $io): void
47  {
48  $Settings_question_behaviour = $this->getTestInstance()->withQuestionTitleOutputMode($io);
49 
50  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
51  $this->assertEquals($io, $Settings_question_behaviour->getQuestionTitleOutputMode());
52  }
53 
54  public static function getAndWithQuestionTitleOutputModeDataProvider(): array
55  {
56  return [
57  [-1],
58  [0],
59  [1]
60  ];
61  }
62 
63  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithInstantFeedbackDataProvider')]
64  public function testGetAndWithAutosaveEnabled(bool $io): void
65  {
66  $Settings_question_behaviour = $this->getTestInstance()->withAutosaveEnabled($io);
67 
68  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
69  $this->assertEquals($io, $Settings_question_behaviour->getAutosaveEnabled());
70  }
71 
72  public static function getAndWithInstantFeedbackDataProvider(): array
73  {
74  return [
75  [false],
76  [true]
77  ];
78  }
79 
80  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithAutosaveIntervalDataProvider')]
81  public function testGetAndWithAutosaveInterval(int $io): void
82  {
83  $Settings_question_behaviour = $this->getTestInstance()->withAutosaveInterval($io);
84 
85  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
86  $this->assertEquals($io, $Settings_question_behaviour->getAutosaveInterval());
87  }
88 
89  public static function getAndWithAutosaveIntervalDataProvider(): array
90  {
91  return [
92  [-1],
93  [0],
94  [1]
95  ];
96  }
97 
98  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithShuffleQuestionsDataProvider')]
99  public function testGetAndWithShuffleQuestions(bool $io): void
100  {
101  $Settings_question_behaviour = $this->getTestInstance()->withShuffleQuestions($io);
102 
103  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
104  $this->assertEquals($io, $Settings_question_behaviour->getShuffleQuestions());
105  }
106 
107  public static function getAndWithShuffleQuestionsDataProvider(): array
108  {
109  return [
110  [false],
111  [true]
112  ];
113  }
114 
115  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithInstantFeedbackPointsEnabledDataProvider')]
116  public function testGetAndWithInstantFeedbackPointsEnabled(bool $io): void
117  {
118  $Settings_question_behaviour = $this->getTestInstance()->withInstantFeedbackPointsEnabled($io);
119 
120  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
121  $this->assertEquals($io, $Settings_question_behaviour->getInstantFeedbackPointsEnabled());
122  }
123 
125  {
126  return [
127  [false],
128  [true]
129  ];
130  }
131 
132  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithInstantFeedbackGenericEnabledDataProvider')]
133  public function testGetAndWithInstantFeedbackGenericEnabled(bool $io): void
134  {
135  $Settings_question_behaviour = $this->getTestInstance()->withInstantFeedbackGenericEnabled($io);
136 
137  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
138  $this->assertEquals($io, $Settings_question_behaviour->getInstantFeedbackGenericEnabled());
139  }
140 
142  {
143  return [
144  [false],
145  [true]
146  ];
147  }
148 
149  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithInstantFeedbackSpecificEnabledDataProvider')]
150  public function testGetAndWithInstantFeedbackSpecificEnabled(bool $io): void
151  {
152  $Settings_question_behaviour = $this->getTestInstance()->withInstantFeedbackSpecificEnabled($io);
153 
154  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
155  $this->assertEquals($io, $Settings_question_behaviour->getInstantFeedbackSpecificEnabled());
156  }
157 
159  {
160  return [
161  [false],
162  [true]
163  ];
164  }
165 
166  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithInstantFeedbackSolutionEnabledDataProvider')]
167  public function testGetAndWithInstantFeedbackSolutionEnabled(bool $io): void
168  {
169  $Settings_question_behaviour = $this->getTestInstance()->withInstantFeedbackSolutionEnabled($io);
170 
171  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
172  $this->assertEquals($io, $Settings_question_behaviour->getInstantFeedbackSolutionEnabled());
173  }
174 
176  {
177  return [
178  [false],
179  [true]
180  ];
181  }
182 
183  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithForceInstantFeedbackOnNextQuestionDataProvider')]
184  public function testGetAndWithForceInstantFeedbackOnNextQuestion(bool $io): void
185  {
186  $Settings_question_behaviour = $this->getTestInstance()->withForceInstantFeedbackOnNextQuestion($io);
187 
188  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
189  $this->assertEquals($io, $Settings_question_behaviour->getForceInstantFeedbackOnNextQuestion());
190  }
191 
193  {
194  return [
195  [false],
196  [true]
197  ];
198  }
199 
200  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithLockAnswerOnInstantFeedbackEnabledDataProvider')]
201  public function testGetAndWithLockAnswerOnInstantFeedbackEnabled(bool $io): void
202  {
203  $Settings_question_behaviour = $this->getTestInstance()->withLockAnswerOnInstantFeedbackEnabled($io);
204 
205  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
206  $this->assertEquals($io, $Settings_question_behaviour->getLockAnswerOnInstantFeedbackEnabled());
207  }
208 
210  {
211  return [
212  [false],
213  [true]
214  ];
215  }
216 
217  #[\PHPUnit\Framework\Attributes\DataProvider('getAndWithLockAnswerOnNextQuestionEnabledDataProvider')]
218  public function testGetAndWithLockAnswerOnNextQuestionEnabled(bool $io): void
219  {
220  $Settings_question_behaviour = $this->getTestInstance()->withLockAnswerOnNextQuestionEnabled($io);
221 
222  $this->assertInstanceOf(SettingsQuestionBehaviour::class, $Settings_question_behaviour);
223  $this->assertEquals($io, $Settings_question_behaviour->getLockAnswerOnNextQuestionEnabled());
224  }
225 
227  {
228  return [
229  [false],
230  [true]
231  ];
232  }
233 }