ILIAS  release_8 Revision v8.23
ilTestSkillLevelThresholdImportListTest.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 ilTestSkillLevelThresholdImportList();
34  }
35 
37  {
38  $this->assertInstanceOf(ilTestSkillLevelThresholdImportList::class, $this->testObj);
39  }
40 
41  public function testAddOriginalSkillTitle(): void
42  {
43  $this->testObj->addOriginalSkillTitle(17, 15, "Test");
44 
45  $reflProp = new ReflectionProperty($this->testObj, "originalSkillTitles");
46  $reflProp->setAccessible(true);
47  $value = $reflProp->getValue($this->testObj);
48 
49  $this->assertEquals(["17:15" => "Test"], $value);
50  }
51 
52  public function testAddOriginalSkillPath(): void
53  {
54  $this->testObj->addOriginalSkillPath(17, 15, "test/path");
55 
56  $reflProp = new ReflectionProperty($this->testObj, "originalSkillPaths");
57  $reflProp->setAccessible(true);
58  $value = $reflProp->getValue($this->testObj);
59 
60  $this->assertEquals(["17:15" => "test/path"], $value);
61  }
62 
63  public function testAddSkillLevelThreshold(): void
64  {
65  $testSkillLevelThresholdImport = new ilTestSkillLevelThresholdImport();
66  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport);
67 
68  $reflProp = new ReflectionProperty($this->testObj, "importedSkillLevelThresholds");
69  $reflProp->setAccessible(true);
70  $value = $reflProp->getValue($this->testObj);
71 
72  $this->assertEquals([$testSkillLevelThresholdImport], $value);
73  }
74 
75  public function testCurrent(): void
76  {
77  $testSkillLevelThresholdImport = new ilTestSkillLevelThresholdImport();
78  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport);
79 
80  $this->assertEquals($testSkillLevelThresholdImport, $this->testObj->current());
81  }
82 
83  public function testNext(): void
84  {
85  $testSkillLevelThresholdImport1 = new ilTestSkillLevelThresholdImport();
86  $testSkillLevelThresholdImport2 = new ilTestSkillLevelThresholdImport();
87 
88  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport1);
89  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport2);
90 
91  $this->testObj->next();
92  $this->assertEquals($testSkillLevelThresholdImport2, $this->testObj->current());
93  }
94 
95  public function testKey(): void
96  {
97  $testSkillLevelThresholdImport1 = new ilTestSkillLevelThresholdImport();
98  $testSkillLevelThresholdImport2 = new ilTestSkillLevelThresholdImport();
99 
100  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport1);
101  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport2);
102 
103  $this->testObj->next();
104  $this->assertEquals(1, $this->testObj->key());
105  }
106 
107  public function testValid(): void
108  {
109  $this->assertFalse($this->testObj->valid());
110  $testSkillLevelThresholdImport1 = new ilTestSkillLevelThresholdImport();
111  $testSkillLevelThresholdImport2 = new ilTestSkillLevelThresholdImport();
112 
113  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport1);
114  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport2);
115 
116  $this->assertTrue($this->testObj->valid());
117  }
118 
119  public function testRewind(): void
120  {
121  $testSkillLevelThresholdImport1 = new ilTestSkillLevelThresholdImport();
122  $testSkillLevelThresholdImport2 = new ilTestSkillLevelThresholdImport();
123 
124  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport1);
125  $this->testObj->addSkillLevelThreshold($testSkillLevelThresholdImport2);
126 
127  $this->testObj->next();
128  $this->testObj->next();
129  $this->testObj->rewind();
130  $this->assertEquals($testSkillLevelThresholdImport1, $this->testObj->current());
131  }
132 }
Class ilTestBaseClass.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...