ILIAS  release_8 Revision v8.24
ilQTIMattextTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22use PHPUnit\Framework\TestCase;
23
24class ilQTIMattextTest extends TestCase
25{
26 public function testConstruct(): void
27 {
28 $this->assertInstanceOf(ilQTIMattext::class, new ilQTIMattext());
29 }
30
31 public function testSetGetTexttype(): void
32 {
33 $instance = new ilQTIMattext();
34 $instance->setTexttype('Some input.');
35 $this->assertEquals('Some input.', $instance->getTexttype());
36 }
37
38 public function testSetGetLabel(): void
39 {
40 $instance = new ilQTIMattext();
41 $instance->setLabel('Some input.');
42 $this->assertEquals('Some input.', $instance->getLabel());
43 }
44
45 public function testSetGetCharset(): void
46 {
47 $instance = new ilQTIMattext();
48 $instance->setCharset('Some input.');
49 $this->assertEquals('Some input.', $instance->getCharset());
50 }
51
52 public function testSetGetUri(): void
53 {
54 $instance = new ilQTIMattext();
55 $instance->setUri('Some input.');
56 $this->assertEquals('Some input.', $instance->getUri());
57 }
58
62 public function testSetGetXmlspace(string $input, ?string $expected): void
63 {
64 $instance = new ilQTIMattext();
65 $instance->setXmlspace($input);
66 $this->assertEquals($expected, $instance->getXmlspace());
67 }
68
69 public function testSetGetXmllang(): void
70 {
71 $instance = new ilQTIMattext();
72 $instance->setXmllang('Some input.');
73 $this->assertEquals('Some input.', $instance->getXmllang());
74 }
75
76 public function testSetGetEntityref(): void
77 {
78 $instance = new ilQTIMattext();
79 $instance->setEntityref('Some input.');
80 $this->assertEquals('Some input.', $instance->getEntityref());
81 }
82
83 public function testSetGetWidth(): void
84 {
85 $instance = new ilQTIMattext();
86 $instance->setWidth('Some input.');
87 $this->assertEquals('Some input.', $instance->getWidth());
88 }
89
90 public function testSetGetHeight(): void
91 {
92 $instance = new ilQTIMattext();
93 $instance->setHeight('Some input.');
94 $this->assertEquals('Some input.', $instance->getHeight());
95 }
96
97 public function testSetGetX0(): void
98 {
99 $instance = new ilQTIMattext();
100 $instance->setX0('Some input.');
101 $this->assertEquals('Some input.', $instance->getX0());
102 }
103
104 public function testSetGetY0(): void
105 {
106 $instance = new ilQTIMattext();
107 $instance->setY0('Some input.');
108 $this->assertEquals('Some input.', $instance->getY0());
109 }
110
111 public function testSetGetContent(): void
112 {
113 $instance = new ilQTIMattext();
114 $instance->setContent('Some input.');
115 $this->assertEquals('Some input.', $instance->getContent());
116 }
117
118 public function xmlSpaces(): array
119 {
120 class_exists(ilQTIMattext::class); // Force autoload to define the constants.
121 return [
122 ['preserve', ilQTIMattext::SPACE_PRESERVE],
124 ['default', ilQTIMattext::SPACE_DEFAULT],
126 ['Random input', null],
127 ];
128 }
129}
testSetGetXmlspace(string $input, ?string $expected)
@dataProvider xmlSpaces