19 declare(strict_types=1);
29 protected function setUp(): void
38 $this->assertInstanceOf(ilTestSkillPointAccount::class, $this->testObj);
43 $maxSkillPoints1 = 80;
44 $reachedSkillPoints1 = 20;
45 $this->testObj->addBooking($maxSkillPoints1, $reachedSkillPoints1);
46 $this->assertEquals($maxSkillPoints1, $this->testObj->getTotalMaxSkillPoints());
47 $this->assertEquals($reachedSkillPoints1, $this->testObj->getTotalReachedSkillPoints());
49 $maxSkillPoints2 = 50;
50 $reachedSkillPoints2 = 10;
51 $this->testObj->addBooking($maxSkillPoints2, $reachedSkillPoints2);
52 $this->assertEquals($maxSkillPoints1 + $maxSkillPoints2, $this->testObj->getTotalMaxSkillPoints());
53 $this->assertEquals($reachedSkillPoints1 + $reachedSkillPoints2, $this->testObj->getTotalReachedSkillPoints());
58 $maxSkillPoints1 = 80;
59 $reachedSkillPoints1 = 20;
60 $maxSkillPoints2 = 20;
61 $reachedSkillPoints2 = 30;
63 $this->testObj->addBooking($maxSkillPoints1, $reachedSkillPoints1);
64 $this->testObj->addBooking($maxSkillPoints2, $reachedSkillPoints2);
65 $this->assertEquals(($reachedSkillPoints1 + $reachedSkillPoints2) / ($maxSkillPoints1 + $maxSkillPoints2) * 100, $this->testObj->getTotalReachedSkillPercent());
ilTestSkillPointAccount $testObj
testGetTotalReachedSkillPercent()
test_instantiateObject_shouldReturnInstance()
Class ilTestSkillPointAccountTest.