ILIAS  release_8 Revision v8.24
ilQTIResponseTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22use PHPUnit\Framework\TestCase;
23
24class 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 [
81 ['Random input.', null],
82 ];
83 }
84}
testSetGetRtiming(string $input, ?string $expected)
@dataProvider rtimings
testSetGetNumtype(string $input, ?string $expected)
@dataProvider numtypes