ILIAS  release_8 Revision v8.24
ilObjTestTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
28
29 protected function setUp(): void
30 {
31 parent::setUp();
32
33 $this->addGlobal_ilUser();
34 $this->addGlobal_lng();
35 $this->addGlobal_ilias();
36 $this->addGlobal_ilDB();
37 $this->addGlobal_ilLog();
38 $this->addGlobal_ilErr();
39 $this->addGlobal_tree();
42
43 $this->testObj = new ilObjTest();
44 }
45
47 {
48 $this->assertInstanceOf(ilObjTest::class, $this->testObj);
49 }
50
51 public function testTmpCopyWizardCopyId(): void
52 {
53 $this->testObj->setTmpCopyWizardCopyId(12);
54 $this->assertEquals(12, $this->testObj->getTmpCopyWizardCopyId());
55 }
56
57 public function testIntroductionEnabled(): void
58 {
59 $this->testObj->setIntroductionEnabled(false);
60 $this->assertFalse($this->testObj->isIntroductionEnabled());
61
62 $this->testObj->setIntroductionEnabled(true);
63 $this->assertTrue($this->testObj->isIntroductionEnabled());
64 }
65
66 public function testIntroduction(): void
67 {
68 $this->assertEmpty($this->testObj->getIntroduction());
69 $this->testObj->setIntroduction("Test");
70 $this->assertEquals("Test", $this->testObj->getIntroduction());
71 }
72
73 public function testFinalStatement(): void
74 {
75 $this->assertEmpty($this->testObj->getFinalStatement());
76 $this->testObj->setFinalStatement("Test");
77 $this->assertEquals("Test", $this->testObj->getFinalStatement());
78 }
79
80 public function testShowInfo(): void
81 {
82 $this->testObj->setShowInfo(0);
83 $this->assertEquals(0, $this->testObj->getShowInfo());
84
85 $this->testObj->setShowInfo(1);
86 $this->assertEquals(1, $this->testObj->getShowInfo());
87 }
88
89 public function testForceJS(): void
90 {
91 $this->testObj->setForceJS(0);
92 $this->assertEquals(0, $this->testObj->getForceJS());
93
94 $this->testObj->setForceJS(1);
95 $this->assertEquals(1, $this->testObj->getForceJS());
96 }
97
98 public function testCustomStyle(): void
99 {
100 $this->testObj->setCustomStyle("Test");
101 $this->assertEquals("Test", $this->testObj->getCustomStyle());
102 }
103
104 public function testShowFinalStatement(): void
105 {
106 $this->testObj->setShowFinalStatement(0);
107 $this->assertEquals(0, $this->testObj->getShowFinalStatement());
108
109 $this->testObj->setShowFinalStatement(1);
110 $this->assertEquals(1, $this->testObj->getShowFinalStatement());
111 }
112
113 public function testTestId(): void
114 {
115 $this->testObj->setTestId(15);
116 $this->assertEquals(15, $this->testObj->getTestId());
117 }
118
119 public function testECTSOutput(): void
120 {
121 $this->testObj->setECTSOutput(0);
122 $this->assertEquals(0, $this->testObj->getECTSOutput());
123
124 $this->testObj->setECTSOutput(1);
125 $this->assertEquals(1, $this->testObj->getECTSOutput());
126 }
127
128 public function testECTSFX(): void
129 {
130 $this->testObj->setECTSFX(123);
131 $this->assertEquals(123, $this->testObj->getECTSFX());
132 }
133
134 public function testECTSGrades(): void
135 {
136 $expected = [1, 6, 112, 160];
137 $this->testObj->setECTSGrades($expected);
138 $this->assertEquals($expected, $this->testObj->getECTSGrades());
139 }
140
141 public function testSequenceSettings(): void
142 {
143 $this->testObj->setSequenceSettings(0);
144 $this->assertEquals(0, $this->testObj->getSequenceSettings());
145
146 $this->testObj->setSequenceSettings(1);
147 $this->assertEquals(1, $this->testObj->getSequenceSettings());
148 }
149
150 public function testIsPostponingEnabled(): void
151 {
152 $this->testObj->setSequenceSettings(0);
153 $this->assertfalse($this->testObj->isPostponingEnabled());
154
155 $this->testObj->setSequenceSettings(1);
156 $this->assertTrue($this->testObj->isPostponingEnabled());
157 }
158
159 public function testSetPostponingEnabled(): void
160 {
161 $this->testObj->setPostponingEnabled(0);
162 $this->assertfalse($this->testObj->isPostponingEnabled());
163
164 $this->testObj->setPostponingEnabled(1);
165 $this->assertTrue($this->testObj->isPostponingEnabled());
166 }
167
168 public function testInstantFeedbackSolution(): void
169 {
170 $this->testObj->setInstantFeedbackSolution(0);
171 $this->assertEquals(0, $this->testObj->getInstantFeedbackSolution());
172
173 $this->testObj->setInstantFeedbackSolution(200);
174 $this->assertEquals(0, $this->testObj->getInstantFeedbackSolution());
175
176 $this->testObj->setInstantFeedbackSolution(1);
177 $this->assertEquals(1, $this->testObj->getInstantFeedbackSolution());
178 }
179
180 public function testGenericAnswerFeedback(): void
181 {
182 $this->testObj->setGenericAnswerFeedback(0);
183 $this->assertEquals(0, $this->testObj->getGenericAnswerFeedback());
184
185 $this->testObj->setGenericAnswerFeedback(200);
186 $this->assertEquals(0, $this->testObj->getGenericAnswerFeedback());
187
188 $this->testObj->setGenericAnswerFeedback(1);
189 $this->assertEquals(1, $this->testObj->getGenericAnswerFeedback());
190 }
191
192 public function testAnswerFeedbackPoints(): void
193 {
194 $this->testObj->setAnswerFeedbackPoints(0);
195 $this->assertEquals(0, $this->testObj->getAnswerFeedbackPoints());
196
197 $this->testObj->setAnswerFeedbackPoints(200);
198 $this->assertEquals(0, $this->testObj->getAnswerFeedbackPoints());
199
200 $this->testObj->setAnswerFeedbackPoints(1);
201 $this->assertEquals(1, $this->testObj->getAnswerFeedbackPoints());
202 }
203
204 public function testBlockPassesAfterPassedEnabled(): void
205 {
206 $this->testObj->setBlockPassesAfterPassedEnabled(false);
207 $this->assertfalse($this->testObj->isBlockPassesAfterPassedEnabled());
208
209 $this->testObj->setBlockPassesAfterPassedEnabled(true);
210 $this->assertTrue($this->testObj->isBlockPassesAfterPassedEnabled());
211 }
212
213 public function testKiosk(): void
214 {
215 $this->testObj->setKiosk(0);
216 $this->assertEquals(0, $this->testObj->getKiosk());
217
218 $this->testObj->setKiosk(22);
219 $this->assertEquals(22, $this->testObj->getKiosk());
220
221 $this->testObj->setKiosk(1);
222 $this->assertEquals(1, $this->testObj->getKiosk());
223 }
224
225 public function testGetKioskMode(): void
226 {
227 $this->testObj->setKiosk(0);
228 $this->assertEquals(false, $this->testObj->getKioskMode());
229
230 $this->testObj->setKiosk(22);
231 $this->assertEquals(false, $this->testObj->getKioskMode());
232
233 $this->testObj->setKiosk(1);
234 $this->assertEquals(1, $this->testObj->getKioskMode());
235 }
236
237 public function testSetKioskMode(): void
238 {
239 $this->testObj->setKioskMode(false);
240 $this->assertFalse($this->testObj->getKioskMode());
241
242 $this->testObj->setKioskMode(true);
243 $this->assertTrue($this->testObj->getKioskMode());
244 }
245
246 public function testStartingTimeEnabled(): void
247 {
248 $this->testObj->setStartingTimeEnabled(false);
249 $this->assertFalse($this->testObj->isStartingTimeEnabled());
250
251 $this->testObj->setStartingTimeEnabled(true);
252 $this->assertTrue($this->testObj->isStartingTimeEnabled());
253 }
254
255 public function testStartingTime(): void
256 {
257 $this->testObj->setStartingTime("0");
258 $this->assertEquals(0, $this->testObj->getStartingTime());
259
260 $this->testObj->setStartingTime("1");
261 $this->assertEquals(1, $this->testObj->getStartingTime());
262 }
263
264 public function testEndingTimeEnabled(): void
265 {
266 $this->testObj->setEndingTimeEnabled(false);
267 $this->assertFalse($this->testObj->isEndingTimeEnabled());
268
269 $this->testObj->setEndingTimeEnabled(true);
270 $this->assertTrue($this->testObj->isEndingTimeEnabled());
271 }
272
273 public function testEndingTime(): void
274 {
275 $this->testObj->setEndingTime(0);
276 $this->assertEquals(0, $this->testObj->getEndingTime());
277
278 $this->testObj->setEndingTime(1);
279 $this->assertEquals(1, $this->testObj->getEndingTime());
280 }
281
282 public function testNrOfTries(): void
283 {
284 $this->testObj->setNrOfTries(0);
285 $this->assertEquals(0, $this->testObj->getNrOfTries());
286
287 $this->testObj->setNrOfTries(22);
288 $this->assertEquals(22, $this->testObj->getNrOfTries());
289
290 $this->testObj->setNrOfTries(1);
291 $this->assertEquals(1, $this->testObj->getNrOfTries());
292 }
293
294 public function testUsePreviousAnswers(): void
295 {
296 $this->testObj->setUsePreviousAnswers(0);
297 $this->assertEquals(0, $this->testObj->getUsePreviousAnswers());
298
299 $this->testObj->setUsePreviousAnswers(1);
300 $this->assertEquals(1, $this->testObj->getUsePreviousAnswers());
301 }
302
303 public function testRedirectionMode(): void
304 {
305 $this->testObj->setRedirectionMode(0);
306 $this->assertEquals(0, $this->testObj->getRedirectionMode());
307
308 $this->testObj->setRedirectionMode(1);
309 $this->assertEquals(1, $this->testObj->getRedirectionMode());
310 }
311
312 public function testRedirectionUrl(): void
313 {
314 $this->testObj->setRedirectionUrl("Test");
315 $this->assertEquals("Test", $this->testObj->getRedirectionUrl());
316 }
317
318 public function testProcessingTime(): void
319 {
320 $this->testObj->setProcessingTime("Test");
321 $this->assertEquals("Test", $this->testObj->getProcessingTime());
322 }
323
324 public function testSetProcessingTimeByMinutes(): void
325 {
326 $this->testObj->setProcessingTimeByMinutes(12);
327 $this->assertEquals("00:12:00", $this->testObj->getProcessingTime());
328 }
329
330 public function testEnableProcessingTime(): void
331 {
332 $this->testObj->setEnableProcessingTime(0);
333 $this->assertEquals(0, $this->testObj->getEnableProcessingTime());
334
335 $this->testObj->setEnableProcessingTime(1);
336 $this->assertEquals(1, $this->testObj->getEnableProcessingTime());
337 }
338
339 public function testResetProcessingTime(): void
340 {
341 $this->testObj->setResetProcessingTime(0);
342 $this->assertEquals(0, $this->testObj->getResetProcessingTime());
343
344 $this->testObj->setResetProcessingTime(1);
345 $this->assertEquals(1, $this->testObj->getResetProcessingTime());
346 }
347
348 public function testPasswordEnabled(): void
349 {
350 $this->testObj->setPasswordEnabled(0);
351 $this->assertEquals(0, $this->testObj->isPasswordEnabled());
352
353 $this->testObj->setPasswordEnabled(1);
354 $this->assertEquals(1, $this->testObj->isPasswordEnabled());
355 }
356
357 public function testPassword(): void
358 {
359 $this->testObj->setPassword("Test");
360 $this->assertEquals("Test", $this->testObj->getPassword());
361 }
362
363 public function testPassWaiting(): void
364 {
365 $this->testObj->setPassWaiting("Test");
366 $this->assertEquals("Test", $this->testObj->getPassWaiting());
367 }
368
369 public function testShuffleQuestions(): void
370 {
371 $this->testObj->setShuffleQuestions(0);
372 $this->assertEquals(0, $this->testObj->getShuffleQuestions());
373
374 $this->testObj->setShuffleQuestions(1);
375 $this->assertEquals(1, $this->testObj->getShuffleQuestions());
376 }
377
378 public function testListOfQuestionsSettings(): void
379 {
380 $this->testObj->setListOfQuestionsSettings(0);
381 $this->assertEquals(0, $this->testObj->getListOfQuestionsSettings());
382
383 $this->testObj->setListOfQuestionsSettings(1);
384 $this->assertEquals(1, $this->testObj->getListOfQuestionsSettings());
385
386 $this->testObj->setListOfQuestionsSettings(22);
387 $this->assertEquals(22, $this->testObj->getListOfQuestionsSettings());
388 }
389
390 public function testListOfQuestions(): void
391 {
392 $this->testObj->setListOfQuestions(0);
393 $this->assertfalse($this->testObj->getListOfQuestions());
394
395 $this->testObj->setListOfQuestions(1);
396 $this->assertTrue($this->testObj->getListOfQuestions());
397 }
398}
Class ilObjTestTest.
testSetProcessingTimeByMinutes()
ilObjTest $testObj
test_instantiateObject_shouldReturnInstance()
testBlockPassesAfterPassedEnabled()
Class ilTestBaseClass.