ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilQTIItemfeedbackTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
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 [
60  ['administrator', ilQTIItemfeedback::VIEW_ADMINISTRATOR],
62  ['adminauthority', ilQTIItemfeedback::VIEW_ADMINAUTHORITY],
68  ['candidate', ilQTIItemfeedback::VIEW_CANDIDATE],
70  ['invigilatorproctor', ilQTIItemfeedback::VIEW_INVIGILATORPROCTOR],
72  ['psychometrician', ilQTIItemfeedback::VIEW_PSYCHOMETRICIAN],
77  ['11', null],
78  ['Random input.', null],
79  ];
80  }
81 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
testSetGetView(string $input, ?string $expected)