ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestQuestionRelatedObjectivesListTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
28 
29  protected function setUp(): void
30  {
31  parent::setUp();
32 
33  $this->testObj = new ilTestQuestionRelatedObjectivesList();
34  }
35 
37  {
38  $this->assertInstanceOf(ilTestQuestionRelatedObjectivesList::class, $this->testObj);
39  }
40 
41  public function testAddQuestionRelatedObjectives(): void
42  {
43  $expected = [
44  1 => [1, 2, 3, 4],
45  2 => [5, 6, 7, 8],
46  1236 => [9, 10, 11, 12],
47  12 => [13, 14, 15, 16]
48  ];
49  foreach ($expected as $key => $value) {
50  $this->testObj->addQuestionRelatedObjectives($key, $value);
51 
52  $this->assertEquals($value, $this->testObj->getQuestionRelatedObjectives($key));
53  }
54  }
55 
56  public function testHasQuestionRelatedObjectives(): void
57  {
58  $expected = [
59  1 => [1, 2, 3, 4],
60  2 => [5, 6, 7, 8],
61  1236 => [9, 10, 11, 12],
62  12 => [13, 14, 16]
63  ];
64  foreach ($expected as $key => $value) {
65  $this->testObj->addQuestionRelatedObjectives($key, $value);
66 
67  $this->assertEquals((bool) count($value), $this->testObj->hasQuestionRelatedObjectives($key));
68  }
69  }
70 }
Class ilTestQuestionRelatedObjectivesListTest.