19 declare(strict_types=1);
39 $test_settings = $this->createConfiguredMock(TestSettings::class, [
'getTestId' => $IO]);
43 $this->createConfiguredMock(SettingsGeneral::class, [
'getTestId' => $IO]),
44 $this->createConfiguredMock(SettingsIntroduction::class, [
'getTestId' => $IO]),
45 $this->createConfiguredMock(SettingsAccess::class, [
'getTestId' => $IO]),
46 $this->createConfiguredMock(SettingsTestBehaviour::class, [
'getTestId' => $IO]),
47 $this->createConfiguredMock(SettingsQuestionBehaviour::class, [
'getTestId' => $IO]),
48 $this->createConfiguredMock(SettingsParticipantFunctionality::class, [
'getTestId' => $IO]),
49 $this->createConfiguredMock(SettingsFinishing::class, [
'getTestId' => $IO]),
50 $this->createConfiguredMock(SettingsAdditional::class, [
'getTestId' => $IO])
53 $output = self::callMethod($main_settings,
'throwOnDifferentTestId', [$test_settings]);
55 $this->assertNull($output);
72 $test_settings = $this->createMock(TestSettings::class);
73 $test_settings->method(
'getTestId')->willReturn($input[
'test_id_1']);
77 $this->createConfiguredMock(SettingsGeneral::class, [
'getTestId' => $input[
'test_id_2']]),
78 $this->createConfiguredMock(SettingsIntroduction::class, [
'getTestId' => $input[
'test_id_2']]),
79 $this->createConfiguredMock(SettingsAccess::class, [
'getTestId' => $input[
'test_id_2']]),
80 $this->createConfiguredMock(SettingsTestBehaviour::class, [
'getTestId' => $input[
'test_id_2']]),
81 $this->createConfiguredMock(SettingsQuestionBehaviour::class, [
'getTestId' => $input[
'test_id_2']]),
82 $this->createConfiguredMock(SettingsParticipantFunctionality::class, [
'getTestId' => $input[
'test_id_2']]),
83 $this->createConfiguredMock(SettingsFinishing::class, [
'getTestId' => $input[
'test_id_2']]),
84 $this->createConfiguredMock(SettingsAdditional::class, [
'getTestId' => $input[
'test_id_2']])
86 $this->expectException(LogicException::class);
87 self::callMethod($main_settings,
'throwOnDifferentTestId', [$test_settings]);
93 [[
'test_id_1' => -1,
'test_id_2' => 0]],
94 [[
'test_id_1' => 0,
'test_id_2' => 1]],
95 [[
'test_id_1' => 1,
'test_id_2' => -1]]
107 $this->createConfiguredMock(
108 SettingsGeneral::class,
109 [
'withTestId' => $this->createMock(SettingsGeneral::class)]
111 $this->createConfiguredMock(
112 SettingsIntroduction::class,
113 [
'withTestId' => $this->createMock(SettingsIntroduction::class)]
115 $this->createConfiguredMock(
116 SettingsAccess::class,
117 [
'withTestId' => $this->createMock(SettingsAccess::class)]
119 $this->createConfiguredMock(
120 SettingsTestBehaviour::class,
121 [
'withTestId' => $this->createMock(SettingsTestBehaviour::class)]
123 $this->createConfiguredMock(
124 SettingsQuestionBehaviour::class,
125 [
'withTestId' => $this->createMock(SettingsQuestionBehaviour::class)]
127 $this->createConfiguredMock(
128 SettingsParticipantFunctionality::class,
129 [
'withTestId' => $this->createMock(SettingsParticipantFunctionality::class)]
131 $this->createConfiguredMock(
132 SettingsFinishing::class,
133 [
'withTestId' => $this->createMock(SettingsFinishing::class)]
135 $this->createConfiguredMock(
136 SettingsAdditional::class,
137 [
'withTestId' => $this->createMock(SettingsAdditional::class)]
142 $this->assertInstanceOf(MainSettings::class, $main_settings);
143 $this->assertEquals($IO, $main_settings->getTestId());
164 $this->createMock(SettingsGeneral::class),
165 $this->createMock(SettingsIntroduction::class),
166 $this->createMock(SettingsAccess::class),
167 $this->createMock(SettingsTestBehaviour::class),
168 $this->createMock(SettingsQuestionBehaviour::class),
169 $this->createMock(SettingsParticipantFunctionality::class),
170 $this->createMock(SettingsFinishing::class),
171 $this->createMock(SettingsAdditional::class)
172 ))->withGeneralSettings($IO);
174 $this->assertInstanceOf(MainSettings::class, $main_settings);
175 $this->assertEquals($IO, $main_settings->getGeneralSettings());
182 $test_case->createMock(SettingsGeneral::class)
195 $this->createMock(SettingsGeneral::class),
196 $this->createMock(SettingsIntroduction::class),
197 $this->createMock(SettingsAccess::class),
198 $this->createMock(SettingsTestBehaviour::class),
199 $this->createMock(SettingsQuestionBehaviour::class),
200 $this->createMock(SettingsParticipantFunctionality::class),
201 $this->createMock(SettingsFinishing::class),
202 $this->createMock(SettingsAdditional::class)
203 ))->withIntroductionSettings($IO);
205 $this->assertInstanceOf(MainSettings::class, $main_settings);
206 $this->assertEquals($IO, $main_settings->getIntroductionSettings());
213 $test_case->createMock(SettingsIntroduction::class)
226 $this->createMock(SettingsGeneral::class),
227 $this->createMock(SettingsIntroduction::class),
228 $this->createMock(SettingsAccess::class),
229 $this->createMock(SettingsTestBehaviour::class),
230 $this->createMock(SettingsQuestionBehaviour::class),
231 $this->createMock(SettingsParticipantFunctionality::class),
232 $this->createMock(SettingsFinishing::class),
233 $this->createMock(SettingsAdditional::class)
234 ))->withAccessSettings($IO);
236 $this->assertInstanceOf(MainSettings::class, $main_settings);
237 $this->assertEquals($IO, $main_settings->getAccessSettings());
244 $test_case->createMock(SettingsAccess::class)
257 $this->createMock(SettingsGeneral::class),
258 $this->createMock(SettingsIntroduction::class),
259 $this->createMock(SettingsAccess::class),
260 $this->createMock(SettingsTestBehaviour::class),
261 $this->createMock(SettingsQuestionBehaviour::class),
262 $this->createMock(SettingsParticipantFunctionality::class),
263 $this->createMock(SettingsFinishing::class),
264 $this->createMock(SettingsAdditional::class)
265 ))->withTestBehaviourSettings($IO);
267 $this->assertInstanceOf(MainSettings::class, $main_settings);
268 $this->assertEquals($IO, $main_settings->getTestBehaviourSettings());
275 $test_case->createMock(SettingsTestBehaviour::class)
288 $this->createMock(SettingsGeneral::class),
289 $this->createMock(SettingsIntroduction::class),
290 $this->createMock(SettingsAccess::class),
291 $this->createMock(SettingsTestBehaviour::class),
292 $this->createMock(SettingsQuestionBehaviour::class),
293 $this->createMock(SettingsParticipantFunctionality::class),
294 $this->createMock(SettingsFinishing::class),
295 $this->createMock(SettingsAdditional::class)
296 ))->withQuestionBehaviourSettings($IO);
298 $this->assertInstanceOf(MainSettings::class, $main_settings);
299 $this->assertEquals($IO, $main_settings->getQuestionBehaviourSettings());
306 $test_case->createMock(SettingsQuestionBehaviour::class)
319 $this->createMock(SettingsGeneral::class),
320 $this->createMock(SettingsIntroduction::class),
321 $this->createMock(SettingsAccess::class),
322 $this->createMock(SettingsTestBehaviour::class),
323 $this->createMock(SettingsQuestionBehaviour::class),
324 $this->createMock(SettingsParticipantFunctionality::class),
325 $this->createMock(SettingsFinishing::class),
326 $this->createMock(SettingsAdditional::class)
327 ))->withParticipantFunctionalitySettings($IO);
329 $this->assertInstanceOf(MainSettings::class, $main_settings);
330 $this->assertEquals($IO, $main_settings->getParticipantFunctionalitySettings());
337 $test_case->createMock(SettingsParticipantFunctionality::class)
350 $this->createMock(SettingsGeneral::class),
351 $this->createMock(SettingsIntroduction::class),
352 $this->createMock(SettingsAccess::class),
353 $this->createMock(SettingsTestBehaviour::class),
354 $this->createMock(SettingsQuestionBehaviour::class),
355 $this->createMock(SettingsParticipantFunctionality::class),
356 $this->createMock(SettingsFinishing::class),
357 $this->createMock(SettingsAdditional::class)
358 ))->withFinishingSettings($IO);
360 $this->assertInstanceOf(MainSettings::class, $main_settings);
361 $this->assertEquals($IO, $main_settings->getFinishingSettings());
368 $test_case->createMock(SettingsFinishing::class)
381 $this->createMock(SettingsGeneral::class),
382 $this->createMock(SettingsIntroduction::class),
383 $this->createMock(SettingsAccess::class),
384 $this->createMock(SettingsTestBehaviour::class),
385 $this->createMock(SettingsQuestionBehaviour::class),
386 $this->createMock(SettingsParticipantFunctionality::class),
387 $this->createMock(SettingsFinishing::class),
388 $this->createMock(SettingsAdditional::class)
389 ))->withAdditionalSettings($IO);
391 $this->assertInstanceOf(MainSettings::class, $main_settings);
392 $this->assertEquals($IO, $main_settings->getAdditionalSettings());
399 $test_case->createMock(SettingsAdditional::class)
static getAndWithTestBehaviourSettingsDataProvider()
testGetAndWithAdditionalSettings(\Closure $IO)
getAndWithAdditionalSettingsDataProvider
static getAndWithParticipantFunctionalitySettingsDataProvider()
static getAndWithIntroductionSettingsDataProvider()
testThrowOnDifferentTestId(int $IO)
throwOnDifferentTestIdDataProvider
static getAndWithFinishingSettingsDataProvider()
static throwOnDifferentTestIdExceptionDataProvider()
testGetAndWithAccessSettings(\Closure $IO)
getAndWithAccessSettingsDataProvider
static getAndWithAccessSettingsDataProvider()
testGetAndWithTestId(int $IO)
getAndWithTestIdDataProvider
static getAndWithGeneralSettingsDataProvider()
static getAndWithAdditionalSettingsDataProvider()
static getAndWithTestIdDataProvider()
testGetAndWithParticipantFunctionalitySettings(\Closure $IO)
getAndWithParticipantFunctionalitySettingsDataProvider
testGetAndWithIntroductionSettings(\Closure $IO)
getAndWithIntroductionSettingsDataProvider
static throwOnDifferentTestIdDataProvider()
testGetAndWithFinishingSettings(\Closure $IO)
getAndWithFinishingSettingsDataProvider
static getAndWithQuestionBehaviourSettingsDataProvider()
testGetAndWithTestBehaviourSettings(\Closure $IO)
getAndWithTestBehaviourSettingsDataProvider
testGetAndWithQuestionBehaviourSettings(\Closure $IO)
getAndWithQuestionBehaviourSettingsDataProvider
testGetAndWithGeneralSettings(\Closure $IO)
getAndWithGeneralSettingsDataProvider
testThrowOnDifferentTestIdException(array $input)
throwOnDifferentTestIdExceptionDataProvider