ILIAS  release_8 Revision v8.24
ilQTIItemfeedbackTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22use PHPUnit\Framework\TestCase;
23
24class ilQTIItemfeedbackTest extends TestCase
25{
26 public function testConstruct(): void
27 {
28 $this->assertInstanceOf(ilQTIItemfeedback::class, new ilQTIItemfeedback());
29 }
30
35 public function testSetGetView(string $input, ?string $expected): void
36 {
37 $instance = new ilQTIItemfeedback();
38 $instance->setView($input);
39 $this->assertEquals($expected, $instance->getView());
40 }
41
42 public function testSetGetIdent(): void
43 {
44 $instance = new ilQTIItemfeedback();
45 $instance->setIdent('Some input.');
46 $this->assertEquals('Some input.', $instance->getIdent());
47 }
48
49 public function testSetGetTitle(): void
50 {
51 $instance = new ilQTIItemfeedback();
52 $instance->setTitle('Some input.');
53 $this->assertEquals('Some input.', $instance->getTitle());
54 }
55
56 public function views(): array
57 {
58 class_exists(ilQTIItemfeedback::class); // Force autoload to define the constants.
59 return [
73 ['invigilatorproctor', ilQTIItemfeedback::VIEW_INVIGILATORPROCTOR],
75 ['psychometrician', ilQTIItemfeedback::VIEW_PSYCHOMETRICIAN],
80 ['11', null],
81 ['Random input.', null],
82 ];
83 }
84}
testSetGetView(string $input, ?string $expected)
@depends testConstruct @dataProvider views