19 declare(strict_types=1);
29 $this->assertInstanceOf(ilQTIAssessmentcontrol::class, $instance);
34 #[\PHPUnit\Framework\Attributes\Depends('testConstruct')] 37 $this->assertEquals(
'All', $instance->
getView());
40 #[\PHPUnit\Framework\Attributes\Depends('testGetView')] 41 #[\PHPUnit\Framework\Attributes\DataProvider('validViews')] 45 $instance->setView($view);
46 $this->assertEquals($view, $instance->getView());
49 #[\PHPUnit\Framework\Attributes\Depends('testSetViewValid')] 53 $instance->setView(
'Some random content.');
54 $this->assertEquals(
'All', $instance->getView());
57 #[\PHPUnit\Framework\Attributes\Depends('testConstruct')] 58 #[\PHPUnit\Framework\Attributes\DataProvider('switches')] 62 $get =
'get' . ucfirst($suffix);
64 $this->assertEquals(
'', $instance->$get());
67 #[\PHPUnit\Framework\Attributes\Depends('testConstruct')] 68 #[\PHPUnit\Framework\Attributes\DataProvider('switches')] 72 $get =
'get' . ucfirst($suffix);
73 $set =
'set' . ucfirst($suffix);
75 $consideredAsYes = [
'Yes',
'yes',
'no',
'',
'Some random thing.'];
76 foreach ($consideredAsYes as $value) {
77 $instance->$set($value);
78 $this->assertEquals(
'Yes', $instance->$get());
83 #[\PHPUnit\Framework\Attributes\Depends('testConstruct')] 84 #[\PHPUnit\Framework\Attributes\DataProvider('switches')] 88 $get =
'get' . ucfirst($suffix);
89 $set =
'set' . ucfirst($suffix);
91 $instance->$set(
'No');
92 $this->assertEquals(
'No', $instance->$get());
103 [
'InvigilatorProctor'],
testSwitchValuesConsideredAsYes(string $suffix)
testSwitchValuesConsideredAsNo(string $suffix)
testGetView(ilQTIAssessmentcontrol $instance)
testSwitchInitializeValue(string $suffix)
testSetViewValid(string $view)