ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilQTIResponseLabelTest.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(ilQTIResponseLabel::class, new ilQTIResponseLabel());
28  }
29 
30  #[\PHPUnit\Framework\Attributes\DataProvider('rshuffles')]
31  public function testSetGetRshuffle(string $input, ?string $expected): void
32  {
33  $instance = new ilQTIResponseLabel();
34  $instance->setRshuffle($input);
35  $this->assertEquals($expected, $instance->getRshuffle());
36  }
37 
38  #[\PHPUnit\Framework\Attributes\DataProvider('areas')]
39  public function testSetGetRarea(string $input, ?string $expected): void
40  {
41  $instance = new ilQTIResponseLabel();
42  $instance->setRarea($input);
43  $this->assertEquals($expected, $instance->getRarea());
44  }
45 
46  #[\PHPUnit\Framework\Attributes\DataProvider('rranges')]
47  public function testSetGetRrange(string $input, ?string $expected): void
48  {
49  $instance = new ilQTIResponseLabel();
50  $instance->setRrange($input);
51  $this->assertEquals($expected, $instance->getRrange());
52  }
53 
54  public function testSetGetLabelrefid(): void
55  {
56  $instance = new ilQTIResponseLabel();
57  $instance->setLabelrefid('Some input.');
58  $this->assertEquals('Some input.', $instance->getLabelrefid());
59  }
60 
61  public function testSetGetIdent(): void
62  {
63  $instance = new ilQTIResponseLabel();
64  $instance->setIdent('Some input.');
65  $this->assertEquals('Some input.', $instance->getIdent());
66  }
67 
68  public function testSetGetMatchGroup(): void
69  {
70  $instance = new ilQTIResponseLabel();
71  $instance->setMatchGroup('Some input.');
72  $this->assertEquals('Some input.', $instance->getMatchGroup());
73  }
74 
75  public function testSetGetMatchMax(): void
76  {
77  $instance = new ilQTIResponseLabel();
78  $instance->setMatchMax('Some input.');
79  $this->assertEquals('Some input.', $instance->getMatchMax());
80  }
81 
82  public function testSetGetContent(): void
83  {
84  $instance = new ilQTIResponseLabel();
85  $instance->setContent('Some input.');
86  $this->assertEquals('Some input.', $instance->getContent());
87  }
88 
89  public static function rshuffles(): array
90  {
91  class_exists(ilQTIResponseLabel::class); // Force autoload to define the constants.
92 
93  return [
98  ['Random input', null],
99  ];
100  }
101 
102  public static function areas(): array
103  {
104  class_exists(ilQTIResponseLabel::class); // Force autoload to define the constants.
105  return [
112  ['Random input', null],
113  ];
114  }
115 
116  public static function rranges(): array
117  {
118  class_exists(ilQTIResponseLabel::class); // Force autoload to define the constants.
119  return [
124  ];
125  }
126 }
testSetGetRarea(string $input, ?string $expected)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
testSetGetRshuffle(string $input, ?string $expected)
testSetGetRrange(string $input, ?string $expected)