ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilQTIMattextTest.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(ilQTIMattext::class, new ilQTIMattext());
28  }
29 
30  public function testSetGetTexttype(): void
31  {
32  $instance = new ilQTIMattext();
33  $instance->setTexttype('Some input.');
34  $this->assertEquals('Some input.', $instance->getTexttype());
35  }
36 
37  public function testSetGetLabel(): void
38  {
39  $instance = new ilQTIMattext();
40  $instance->setLabel('Some input.');
41  $this->assertEquals('Some input.', $instance->getLabel());
42  }
43 
44  public function testSetGetCharset(): void
45  {
46  $instance = new ilQTIMattext();
47  $instance->setCharset('Some input.');
48  $this->assertEquals('Some input.', $instance->getCharset());
49  }
50 
51  public function testSetGetUri(): void
52  {
53  $instance = new ilQTIMattext();
54  $instance->setUri('Some input.');
55  $this->assertEquals('Some input.', $instance->getUri());
56  }
57 
61  public function testSetGetXmlspace(string $input, ?string $expected): void
62  {
63  $instance = new ilQTIMattext();
64  $instance->setXmlspace($input);
65  $this->assertEquals($expected, $instance->getXmlspace());
66  }
67 
68  public function testSetGetXmllang(): void
69  {
70  $instance = new ilQTIMattext();
71  $instance->setXmllang('Some input.');
72  $this->assertEquals('Some input.', $instance->getXmllang());
73  }
74 
75  public function testSetGetEntityref(): void
76  {
77  $instance = new ilQTIMattext();
78  $instance->setEntityref('Some input.');
79  $this->assertEquals('Some input.', $instance->getEntityref());
80  }
81 
82  public function testSetGetWidth(): void
83  {
84  $instance = new ilQTIMattext();
85  $instance->setWidth('Some input.');
86  $this->assertEquals('Some input.', $instance->getWidth());
87  }
88 
89  public function testSetGetHeight(): void
90  {
91  $instance = new ilQTIMattext();
92  $instance->setHeight('Some input.');
93  $this->assertEquals('Some input.', $instance->getHeight());
94  }
95 
96  public function testSetGetX0(): void
97  {
98  $instance = new ilQTIMattext();
99  $instance->setX0('Some input.');
100  $this->assertEquals('Some input.', $instance->getX0());
101  }
102 
103  public function testSetGetY0(): void
104  {
105  $instance = new ilQTIMattext();
106  $instance->setY0('Some input.');
107  $this->assertEquals('Some input.', $instance->getY0());
108  }
109 
110  public function testSetGetContent(): void
111  {
112  $instance = new ilQTIMattext();
113  $instance->setContent('Some input.');
114  $this->assertEquals('Some input.', $instance->getContent());
115  }
116 
117  public static function xmlSpaces(): array
118  {
119  class_exists(ilQTIMattext::class); // Force autoload to define the constants.
120  return [
121  ['preserve', ilQTIMattext::SPACE_PRESERVE],
123  ['default', ilQTIMattext::SPACE_DEFAULT],
125  ['Random input', null],
126  ];
127  }
128 }
testSetGetXmlspace(string $input, ?string $expected)
xmlSpaces
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null