ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilQTIItemTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
22
23class ilQTIItemTest extends TestCase
24{
25 public function testConstruct(): void
26 {
27 $this->assertInstanceOf(ilQTIItem::class, new ilQTIItem());
28 }
29
30 public function testSetGetIdent(): void
31 {
32 $instance = new ilQTIItem();
33 $instance->setIdent('Some input.');
34 $this->assertEquals('Some input.', $instance->getIdent());
35 }
36
37 public function testSetGetTitle(): void
38 {
39 $instance = new ilQTIItem();
40 $instance->setTitle('Some input.');
41 $this->assertEquals('Some input.', $instance->getTitle());
42 }
43
44 public function testSetGetLabel(): void
45 {
46 $instance = new ilQTIItem();
47 $instance->setLabel('Some input.');
48 $this->assertEquals('Some input.', $instance->getLabel());
49 }
50
51 public function testSetGetXmllang(): void
52 {
53 $instance = new ilQTIItem();
54 $instance->setXmllang('Some input.');
55 $this->assertEquals('Some input.', $instance->getXmllang());
56 }
57
58 public function testSetGetComment(): void
59 {
60 $instance = new ilQTIItem();
61 $instance->setComment('Some input.');
62 $this->assertEquals('Some input.', $instance->getComment());
63 }
64
65 public function testSetGetIlias_version(): void
66 {
67 $instance = new ilQTIItem();
68 $instance->setComment('ILIAS Version=8.0');
69 $this->assertEquals('8.0', $instance->ilias_version);
70 }
71
72 public function testSetGetAuthor(): void
73 {
74 $instance = new ilQTIItem();
75 $instance->setAuthor('Some input.');
76 $this->assertEquals('Some input.', $instance->getAuthor());
77
78 $instance->setComment('Author=Lukas Scharmer');
79 $this->assertEquals('Lukas Scharmer', $instance->getAuthor());
80 }
81
82 public function testSetGetQuestiontype(): void
83 {
84 $instance = new ilQTIItem();
85 $instance->setQuestiontype('Some input.');
86 $this->assertEquals('Some input.', $instance->getQuestiontype());
87
88 $instance->setComment('Questiontype=Abc');
89 $this->assertEquals('Abc', $instance->getQuestionType());
90 }
91
92 public function testSetGetIliasSourceVersion(): void
93 {
94 $instance = new ilQTIItem();
95 $instance->setIliasSourceVersion('Some input.');
96 $this->assertEquals('Some input.', $instance->getIliasSourceVersion());
97 }
98}
testSetGetIliasSourceVersion()