ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilQTIResponseTest.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(ilQTIResponse::class, new ilQTIResponse());
28  }
29 
30  public function testSetGetIdent(): void
31  {
32  $instance = new ilQTIResponse();
33  $instance->setIdent('Some input.');
34  $this->assertEquals('Some input.', $instance->getIdent());
35  }
36 
40  public function testSetGetRtiming(string $input, ?string $expected): void
41  {
42  $instance = new ilQTIResponse();
43  $instance->setRtiming($input);
44  $this->assertEquals($expected, $instance->getRtiming());
45  }
46 
50  public function testSetGetNumtype(string $input, ?string $expected): void
51  {
52  $instance = new ilQTIResponse();
53  $instance->setNumtype($input);
54  $this->assertEquals($expected, $instance->getNumtype());
55  }
56 
57  public static function rtimings(): array
58  {
59  class_exists(ilQTIResponse::class); // Force autoload to define the constants.
60 
61  return [
66  ['Random input.', null],
67  ];
68  }
69 
70  public static function numtypes(): array
71  {
72  class_exists(ilQTIResponse::class); // Force autoload to define the constants.
73  return [
74  ['integer', ilQTIResponse::NUMTYPE_INTEGER],
76  ['decimal', ilQTIResponse::NUMTYPE_DECIMAL],
78  ['scientific', ilQTIResponse::NUMTYPE_SCIENTIFIC],
80  ['Random input.', null],
81  ];
82  }
83 }
testSetGetRtiming(string $input, ?string $expected)
rtimings
testSetGetNumtype(string $input, ?string $expected)
numtypes
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null