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