ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestQuestionRelatedObjectivesListTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
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 
53  $this->assertEquals($expected[1236], $this->testObj->getQuestionRelatedObjectives(1236));
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 
68  $this->assertEquals(3, $this->testObj->hasQuestionRelatedObjectives(12));
69  }
70 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $key
Consumer key/client ID value.
Definition: System.php:193
Class ilTestBaseClass.