ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilQTIResponseVarTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
25  public function testConstruct(): void
26  {
27  $this->assertInstanceOf(ilQTIResponseVar::class, new ilQTIResponseVar('a'));
28  }
29 
30  public function testSetGetVartype(): void
31  {
32  $instance = new ilQTIResponseVar('a');
33  $instance->setVartype('Some input.');
34  $this->assertEquals('Some input.', $instance->getVartype());
35  }
36 
40  public function testSetGetCase(string $input, ?string $expected): void
41  {
42  $instance = new ilQTIResponseVar('a');
43  $instance->setCase($input);
44  $this->assertEquals($expected, $instance->getCase());
45  }
46 
47  public function testSetGetRespident(): void
48  {
49  $instance = new ilQTIResponseVar('a');
50  $instance->setRespident('Some input.');
51  $this->assertEquals('Some input.', $instance->getRespident());
52  }
53 
54  public function testSetGetIndex(): void
55  {
56  $instance = new ilQTIResponseVar('a');
57  $instance->setIndex('Some input.');
58  $this->assertEquals('Some input.', $instance->getIndex());
59  }
60 
64  public function testSetGetSetmatch(string $input, ?string $expected): void
65  {
66  $instance = new ilQTIResponseVar('a');
67  $instance->setSetmatch($input);
68  $this->assertEquals($expected, $instance->getSetmatch());
69  }
70 
74  public function testSetGetAreatype(string $input, ?string $expected): void
75  {
76  $instance = new ilQTIResponseVar('a');
77  $instance->setAreatype($input);
78  $this->assertEquals($expected, $instance->getAreatype());
79  }
80 
81  public function testSetGetContent(): void
82  {
83  $instance = new ilQTIResponseVar('a');
84  $instance->setContent('Some input.');
85  $this->assertEquals('Some input.', $instance->getContent());
86  }
87 
88  public static function cases(): array
89  {
90  class_exists(ilQTIResponseVar::class); // Force autoload to define the constants.
91  return [
96  ];
97  }
98 
99  public static function setMatches(): array
100  {
101  class_exists(ilQTIRespcondition::class); // Force autoload to define the constants.
102  return [
107  ];
108  }
109 
110  public static function areaTypes(): array
111  {
112  class_exists(ilQTIRespcondition::class); // Force autoload to define the constants.
113  return [
120  ];
121  }
122 }
testSetGetCase(string $input, ?string $expected)
cases
testSetGetSetmatch(string $input, ?string $expected)
setMatches
testSetGetAreatype(string $input, ?string $expected)
areaTypes