ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilQTIItemfeedbackTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
22
23class ilQTIItemfeedbackTest extends TestCase
24{
25 public function testConstruct(): void
26 {
27 $this->assertInstanceOf(ilQTIItemfeedback::class, new ilQTIItemfeedback());
28 }
29
30 #[\PHPUnit\Framework\Attributes\Depends('testConstruct')]
31 #[\PHPUnit\Framework\Attributes\DataProvider('views')]
32 public function testSetGetView(string $input, ?string $expected): void
33 {
34 $instance = new ilQTIItemfeedback();
35 $instance->setView($input);
36 $this->assertEquals($expected, $instance->getView());
37 }
38
39 public function testSetGetIdent(): void
40 {
41 $instance = new ilQTIItemfeedback();
42 $instance->setIdent('Some input.');
43 $this->assertEquals('Some input.', $instance->getIdent());
44 }
45
46 public function testSetGetTitle(): void
47 {
48 $instance = new ilQTIItemfeedback();
49 $instance->setTitle('Some input.');
50 $this->assertEquals('Some input.', $instance->getTitle());
51 }
52
53 public static function views(): array
54 {
55 class_exists(ilQTIItemfeedback::class); // Force autoload to define the constants.
56 return [
70 ['invigilatorproctor', ilQTIItemfeedback::VIEW_INVIGILATORPROCTOR],
72 ['psychometrician', ilQTIItemfeedback::VIEW_PSYCHOMETRICIAN],
77 ['11', null],
78 ['Random input.', null],
79 ];
80 }
81}
testSetGetView(string $input, ?string $expected)