ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SettingsTestBehaviourTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
28  public function testGetAndWithNumberOfTries(int $io): void
29  {
30  $Settings_test_behaviour = (new SettingsTestBehaviour(0))->withNumberOfTries($io);
31 
32  $this->assertInstanceOf(SettingsTestBehaviour::class, $Settings_test_behaviour);
33  $this->assertEquals($io, $Settings_test_behaviour->getNumberOfTries());
34  }
35 
36  public static function getAndWithNumberOfTriesDataProvider(): array
37  {
38  return [
39  [-1],
40  [0],
41  [1]
42  ];
43  }
44 
48  public function testGetAndWithBlockAfterPassedEnabled(): void
49  {
50  $Settings_test_behaviour = (new SettingsTestBehaviour(0))->withBlockAfterPassedEnabled(true);
51 
52  $this->assertInstanceOf(SettingsTestBehaviour::class, $Settings_test_behaviour);
53  $this->assertTrue($Settings_test_behaviour->getBlockAfterPassedEnabled());
54  }
55 
56  public static function getAndWithBlockAfterPassedEnabledDataProvider(): array
57  {
58  return [
59  [true],
60  [false]
61  ];
62  }
63 
67  public function testGetAndWithPassWaiting(?string $io): void
68  {
69  $Settings_test_behaviour = (new SettingsTestBehaviour(0))->withPassWaiting($io);
70 
71  $this->assertInstanceOf(SettingsTestBehaviour::class, $Settings_test_behaviour);
72  $this->assertEquals($io, $Settings_test_behaviour->getPassWaiting());
73  }
74 
75  public static function getAndWithPassWaitingDataProvider(): array
76  {
77  return [
78  [null],
79  ['0:0:0']
80  ];
81  }
82 
86  public function testGetAndWithProcessingTimeEnabled(bool $io): void
87  {
88  $Settings_test_behaviour = (new SettingsTestBehaviour(0))->withProcessingTimeEnabled($io);
89 
90  $this->assertInstanceOf(SettingsTestBehaviour::class, $Settings_test_behaviour);
91  $this->assertEquals($io, $Settings_test_behaviour->getProcessingTimeEnabled());
92  }
93 
94  public static function getAndWithProcessingTimeEnabledDataProvider(): array
95  {
96  return [
97  [true],
98  [false]
99  ];
100  }
101 
105  public function testGetAndWithProcessingTime(?string $io): void
106  {
107  $Settings_test_behaviour = (new SettingsTestBehaviour(0))->withProcessingTime($io);
108 
109  $this->assertInstanceOf(SettingsTestBehaviour::class, $Settings_test_behaviour);
110  $this->assertEquals($io, $Settings_test_behaviour->getProcessingTime());
111  }
112 
113  public static function getAndWithProcessingTimeDataProvider(): array
114  {
115  return [
116  [null],
117  [''],
118  ['string']
119  ];
120  }
121 
125  public function testGetAndWithResetProcessingTime(bool $io): void
126  {
127  $Settings_test_behaviour = (new SettingsTestBehaviour(0))->withResetProcessingTime($io);
128 
129  $this->assertInstanceOf(SettingsTestBehaviour::class, $Settings_test_behaviour);
130  $this->assertEquals($io, $Settings_test_behaviour->getResetProcessingTime());
131  }
132 
133  public static function getAndWithResetProcessingTimeDataProvider(): array
134  {
135  return [
136  [true],
137  [false]
138  ];
139  }
140 
144  public function testGetAndWithKioskMode(int $io): void
145  {
146  $Settings_test_behaviour = (new SettingsTestBehaviour(0))->withKioskMode($io);
147 
148  $this->assertInstanceOf(SettingsTestBehaviour::class, $Settings_test_behaviour);
149  $this->assertEquals($io, $Settings_test_behaviour->getKioskMode());
150  }
151 
152  public static function getAndWithKioskModeDataProvider(): array
153  {
154  return [
155  [-1],
156  [0],
157  [1]
158  ];
159  }
160 
161  // ExamIdInTestPassEnabled
165  public function testGetAndWithExamIdInTestPassEnabled(bool $io): void
166  {
167  $Settings_test_behaviour = (new SettingsTestBehaviour(0))->withExamIdInTestAttemptEnabled($io);
168 
169  $this->assertInstanceOf(SettingsTestBehaviour::class, $Settings_test_behaviour);
170  $this->assertEquals($io, $Settings_test_behaviour->getExamIdInTestAttemptEnabled());
171  }
172 
173  public static function getAndWithExamIdInTestPassEnabledDataProvider(): array
174  {
175  return [
176  [true],
177  [false]
178  ];
179  }
180 }
testGetAndWithProcessingTimeEnabled(bool $io)
getAndWithProcessingTimeEnabledDataProvider
testGetAndWithPassWaiting(?string $io)
getAndWithPassWaitingDataProvider
testGetAndWithProcessingTime(?string $io)
getAndWithProcessingTimeDataProvider
testGetAndWithKioskMode(int $io)
getAndWithKioskModeDataProvider
testGetAndWithBlockAfterPassedEnabled()
getAndWithBlockAfterPassedEnabledDataProvider
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
testGetAndWithExamIdInTestPassEnabled(bool $io)
getAndWithExamIdInTestPassEnabledDataProvider
testGetAndWithResetProcessingTime(bool $io)
getAndWithResetProcessingTimeDataProvider
testGetAndWithNumberOfTries(int $io)
getAndWithNumberOfTriesDataProvider