ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestParticipantScoringTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
28
29 protected function setUp(): void
30 {
31 parent::setUp();
32
33 $this->testObj = new ilTestParticipantScoring();
34 }
35
37 {
38 $this->assertInstanceOf(ilTestParticipantScoring::class, $this->testObj);
39 }
40
41 public function testActiveId(): void
42 {
43 $activeId = 210;
44 $this->testObj->setActiveId($activeId);
45 $this->assertEquals($activeId, $this->testObj->getActiveId());
46 }
47
48 public function testScoredPass(): void
49 {
50 $scoredPass = 210;
51 $this->testObj->setScoredPass($scoredPass);
52 $this->assertEquals($scoredPass, $this->testObj->getScoredPass());
53 }
54
55 public function testAnsweredQuestions(): void
56 {
57 $answeredQuestions = 210;
58 $this->testObj->setAnsweredQuestions($answeredQuestions);
59 $this->assertEquals($answeredQuestions, $this->testObj->getAnsweredQuestions());
60 }
61
62 public function testTotalQuestions(): void
63 {
64 $totalQuestions = 210;
65 $this->testObj->setTotalQuestions($totalQuestions);
66 $this->assertEquals($totalQuestions, $this->testObj->getTotalQuestions());
67 }
68
69 public function testReachedPoints(): void
70 {
71 $reachedPoints = 210;
72 $this->testObj->setReachedPoints($reachedPoints);
73 $this->assertEquals($reachedPoints, $this->testObj->getReachedPoints());
74 }
75
76 public function testMaxPoints(): void
77 {
78 $maxPoints = 210;
79 $this->testObj->setMaxPoints($maxPoints);
80 $this->assertEquals($maxPoints, $this->testObj->getMaxPoints());
81 }
82
83 public function testPassed(): void
84 {
85 $this->testObj->setPassed(false);
86 $this->assertFalse($this->testObj->isPassed());
87
88 $this->testObj->setPassed(true);
89 $this->assertTrue($this->testObj->isPassed());
90 }
91
92 public function testFinalMark(): void
93 {
94 $finalMark = 'testString';
95 $this->testObj->setFinalMark($finalMark);
96 $this->assertEquals($finalMark, $this->testObj->getFinalMark());
97 }
98
99 public function testGetPercentResult(): void
100 {
101 $this->assertEquals(0, $this->testObj->getPercentResult());
102
103 $maxPoints = 20;
104 $reachedPoints = 12;
105 $this->testObj->setMaxPoints($maxPoints);
106 $this->testObj->setReachedPoints($reachedPoints);
107 $this->assertEquals($reachedPoints / $maxPoints, $this->testObj->getPercentResult());
108 }
109}
Class ilTestBaseClass.
Class ilTestParticipantScoringTest.