ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilQTIResponseTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
23 
24 class ilQTIResponseTest extends TestCase
25 {
26  public function testConstruct(): void
27  {
28  $this->assertInstanceOf(ilQTIResponse::class, new ilQTIResponse());
29  }
30 
31  public function testSetGetIdent(): void
32  {
33  $instance = new ilQTIResponse();
34  $instance->setIdent('Some input.');
35  $this->assertEquals('Some input.', $instance->getIdent());
36  }
37 
41  public function testSetGetRtiming(string $input, ?string $expected): void
42  {
43  $instance = new ilQTIResponse();
44  $instance->setRtiming($input);
45  $this->assertEquals($expected, $instance->getRtiming());
46  }
47 
51  public function testSetGetNumtype(string $input, ?string $expected): void
52  {
53  $instance = new ilQTIResponse();
54  $instance->setNumtype($input);
55  $this->assertEquals($expected, $instance->getNumtype());
56  }
57 
58  public function rtimings(): array
59  {
60  class_exists(ilQTIResponse::class); // Force autoload to define the constants.
61 
62  return [
67  ['Random input.', null],
68  ];
69  }
70 
71  public function numtypes(): array
72  {
73  class_exists(ilQTIResponse::class); // Force autoload to define the constants.
74  return [
75  ['integer', ilQTIResponse::NUMTYPE_INTEGER],
77  ['decimal', ilQTIResponse::NUMTYPE_DECIMAL],
79  ['scientific', ilQTIResponse::NUMTYPE_SCIENTIFIC],
81  ['Random input.', null],
82  ];
83  }
84 }
testSetGetRtiming(string $input, ?string $expected)
rtimings
testSetGetNumtype(string $input, ?string $expected)
numtypes