ILIAS  release_8 Revision v8.24
ilQTIResponseVarTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22use PHPUnit\Framework\TestCase;
23
24class ilQTIResponseVarTest extends TestCase
25{
26 public function testConstruct(): void
27 {
28 $this->assertInstanceOf(ilQTIResponseVar::class, new ilQTIResponseVar('a'));
29 }
30
31 public function testSetGetVartype(): void
32 {
33 $instance = new ilQTIResponseVar('a');
34 $instance->setVartype('Some input.');
35 $this->assertEquals('Some input.', $instance->getVartype());
36 }
37
41 public function testSetGetCase(string $input, ?string $expected): void
42 {
43 $instance = new ilQTIResponseVar('a');
44 $instance->setCase($input);
45 $this->assertEquals($expected, $instance->getCase());
46 }
47
48 public function testSetGetRespident(): void
49 {
50 $instance = new ilQTIResponseVar('a');
51 $instance->setRespident('Some input.');
52 $this->assertEquals('Some input.', $instance->getRespident());
53 }
54
55 public function testSetGetIndex(): void
56 {
57 $instance = new ilQTIResponseVar('a');
58 $instance->setIndex('Some input.');
59 $this->assertEquals('Some input.', $instance->getIndex());
60 }
61
65 public function testSetGetSetmatch(string $input, ?string $expected): void
66 {
67 $instance = new ilQTIResponseVar('a');
68 $instance->setSetmatch($input);
69 $this->assertEquals($expected, $instance->getSetmatch());
70 }
71
75 public function testSetGetAreatype(string $input, ?string $expected): void
76 {
77 $instance = new ilQTIResponseVar('a');
78 $instance->setAreatype($input);
79 $this->assertEquals($expected, $instance->getAreatype());
80 }
81
82 public function testSetGetContent(): void
83 {
84 $instance = new ilQTIResponseVar('a');
85 $instance->setContent('Some input.');
86 $this->assertEquals('Some input.', $instance->getContent());
87 }
88
89 public function cases(): array
90 {
91 class_exists(ilQTIResponseVar::class); // Force autoload to define the constants.
92 return [
97 ];
98 }
99
100 public function setMatches(): array
101 {
102 class_exists(ilQTIRespcondition::class); // Force autoload to define the constants.
103 return [
108 ];
109 }
110
111 public function areaTypes(): array
112 {
113 class_exists(ilQTIRespcondition::class); // Force autoload to define the constants.
114 return [
121 ];
122 }
123}
testSetGetAreatype(string $input, ?string $expected)
@dataProvider areaTypes
testSetGetCase(string $input, ?string $expected)
@dataProvider cases
testSetGetSetmatch(string $input, ?string $expected)
@dataProvider setMatches