ILIAS  release_8 Revision v8.23
ilTestEvaluationPassDataTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTestEvaluationPassDataTest:
+ Collaboration diagram for ilTestEvaluationPassDataTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 test__sleep ()
 
 testNrOfAnsweredQuestions ()
 
 testReachedPoints ()
 
 testMaxPoints ()
 
 testQuestionCount ()
 
 testWorkingTime ()
 
 testPass ()
 
 testAnsweredQuestions ()
 
 testGetAnsweredQuestionByQuestionId ()
 
 testGetAnsweredQuestionCount ()
 
 testRequestedHintsCount ()
 
 testDeductedHintPoints ()
 
 testObligationsAnswered ()
 
 testExamId ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 
 addGlobal_ilAccess ()
 
 addGlobal_ilUser ()
 
 addGlobal_objDefinition ()
 
 addGlobal_tree ()
 
 addGlobal_ilSetting ()
 
 addGlobal_rbacsystem ()
 
 addGlobal_ilCtrl ()
 
 addGlobal_lng ()
 
 addGlobal_filesystem ()
 
 addGlobal_upload ()
 
 addGlobal_ilDB ()
 
 addGlobal_ilLog ()
 
 addGlobal_ilias ()
 
 addGlobal_ilErr ()
 
 addGlobal_ilAppEventHandler ()
 
 addGlobal_tpl ()
 
 addGlobal_ilComponentRepository ()
 
 addGlobal_ilTabs ()
 
 addGlobal_ilObjDataCache ()
 
 addGlobal_ilLocator ()
 
 addGlobal_rbacreview ()
 
 addGlobal_ilToolbar ()
 
 addGlobal_http ()
 
 addGlobal_ilIliasIniFile ()
 
 addGlobal_ilLoggerFactory ()
 
 addGlobal_ilHelp ()
 
 addGlobal_ui ()
 
 addGlobal_uiFactory ()
 
 addGlobal_uiRenderer ()
 
 addGlobal_refinery ()
 

Private Attributes

ilTestEvaluationPassData $testObj
 

Additional Inherited Members

- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilTestEvaluationPassDataTest

Author
Marvin Beym mbeym.nosp@m.@dat.nosp@m.abay..nosp@m.de

Definition at line 25 of file ilTestEvaluationPassDataTest.php.

Member Function Documentation

◆ setUp()

ilTestEvaluationPassDataTest::setUp ( )
protected

Definition at line 29 of file ilTestEvaluationPassDataTest.php.

29  : void
30  {
31  parent::setUp();
32 
33  $this->testObj = new ilTestEvaluationPassData();
34  }

◆ test__sleep()

ilTestEvaluationPassDataTest::test__sleep ( )

Definition at line 41 of file ilTestEvaluationPassDataTest.php.

41  : void
42  {
43  $expected = [
44  "answeredQuestions",
45  "pass",
46  "nrOfAnsweredQuestions",
47  "reachedpoints",
48  "maxpoints",
49  "questioncount",
50  "workingtime",
51  "examId"
52  ];
53  $this->assertEquals($expected, $this->testObj->__sleep());
54  }

◆ test_instantiateObject_shouldReturnInstance()

ilTestEvaluationPassDataTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file ilTestEvaluationPassDataTest.php.

36  : void
37  {
38  $this->assertInstanceOf(ilTestEvaluationPassData::class, $this->testObj);
39  }

◆ testAnsweredQuestions()

ilTestEvaluationPassDataTest::testAnsweredQuestions ( )

Definition at line 92 of file ilTestEvaluationPassDataTest.php.

92  : void
93  {
94  $expected = [
95  ["id" => 20, "points" => 2.5, "reached" => 1.5, "isAnswered" => true, "sequence" => null, "manual" => 0],
96  ["id" => 12, "points" => 12.5, "reached" => 11, "isAnswered" => true, "sequence" => null, "manual" => 1],
97  ["id" => 165, "points" => -5.5, "reached" => 0, "isAnswered" => false, "sequence" => null, "manual" => 0],
98  ["id" => 4, "points" => 55.5, "reached" => 200, "isAnswered" => false, "sequence" => null, "manual" => 1],
99  ];
100 
101  foreach ($expected as $value) {
102  $this->testObj->addAnsweredQuestion(
103  $value["id"],
104  $value["points"],
105  $value["reached"],
106  $value["isAnswered"],
107  $value["sequence"],
108  $value["manual"],
109  );
110  }
111 
112  $this->assertEquals($expected, $this->testObj->getAnsweredQuestions());
113 
114  $this->assertEquals($expected[1], $this->testObj->getAnsweredQuestion(1));
115  }

◆ testDeductedHintPoints()

ilTestEvaluationPassDataTest::testDeductedHintPoints ( )

Definition at line 170 of file ilTestEvaluationPassDataTest.php.

170  : void
171  {
172  $this->testObj->setDeductedHintPoints(5);
173 
174  $this->assertEquals(5, $this->testObj->getDeductedHintPoints());
175  }

◆ testExamId()

ilTestEvaluationPassDataTest::testExamId ( )

Definition at line 184 of file ilTestEvaluationPassDataTest.php.

184  : void
185  {
186  $this->testObj->setExamId("5");
187 
188  $this->assertEquals("5", $this->testObj->getExamId());
189  }

◆ testGetAnsweredQuestionByQuestionId()

ilTestEvaluationPassDataTest::testGetAnsweredQuestionByQuestionId ( )

Definition at line 117 of file ilTestEvaluationPassDataTest.php.

117  : void
118  {
119  $expected = [
120  ["id" => 20, "points" => 2.5, "reached" => 1.5, "isAnswered" => true, "sequence" => null, "manual" => 0],
121  ["id" => 12, "points" => 12.5, "reached" => 11, "isAnswered" => true, "sequence" => null, "manual" => 1],
122  ["id" => 165, "points" => -5.5, "reached" => 0, "isAnswered" => false, "sequence" => null, "manual" => 0],
123  ["id" => 4, "points" => 55.5, "reached" => 200, "isAnswered" => false, "sequence" => null, "manual" => 1],
124  ];
125 
126  foreach ($expected as $value) {
127  $this->testObj->addAnsweredQuestion(
128  $value["id"],
129  $value["points"],
130  $value["reached"],
131  $value["isAnswered"],
132  $value["sequence"],
133  $value["manual"],
134  );
135  }
136 
137  $this->assertEquals($expected[1], $this->testObj->getAnsweredQuestionByQuestionId(12));
138  }

◆ testGetAnsweredQuestionCount()

ilTestEvaluationPassDataTest::testGetAnsweredQuestionCount ( )

Definition at line 140 of file ilTestEvaluationPassDataTest.php.

140  : void
141  {
142  $expected = [
143  ["id" => 20, "points" => 2.5, "reached" => 1.5, "isAnswered" => true, "sequence" => null, "manual" => 0],
144  ["id" => 12, "points" => 12.5, "reached" => 11, "isAnswered" => true, "sequence" => null, "manual" => 1],
145  ["id" => 165, "points" => -5.5, "reached" => 0, "isAnswered" => false, "sequence" => null, "manual" => 0],
146  ["id" => 4, "points" => 55.5, "reached" => 200, "isAnswered" => false, "sequence" => null, "manual" => 1],
147  ];
148 
149  foreach ($expected as $value) {
150  $this->testObj->addAnsweredQuestion(
151  $value["id"],
152  $value["points"],
153  $value["reached"],
154  $value["isAnswered"],
155  $value["sequence"],
156  $value["manual"],
157  );
158  }
159 
160  $this->assertEquals(4, $this->testObj->getAnsweredQuestionCount());
161  }

◆ testMaxPoints()

ilTestEvaluationPassDataTest::testMaxPoints ( )

Definition at line 68 of file ilTestEvaluationPassDataTest.php.

68  : void
69  {
70  $this->testObj->setMaxPoints(20);
71  $this->assertEquals(20, $this->testObj->getMaxPoints());
72  }

◆ testNrOfAnsweredQuestions()

ilTestEvaluationPassDataTest::testNrOfAnsweredQuestions ( )

Definition at line 56 of file ilTestEvaluationPassDataTest.php.

56  : void
57  {
58  $this->testObj->setNrOfAnsweredQuestions(20);
59  $this->assertEquals(20, $this->testObj->getNrOfAnsweredQuestions());
60  }

◆ testObligationsAnswered()

ilTestEvaluationPassDataTest::testObligationsAnswered ( )

Definition at line 177 of file ilTestEvaluationPassDataTest.php.

177  : void
178  {
179  $this->testObj->setObligationsAnswered(true);
180 
181  $this->assertTrue($this->testObj->areObligationsAnswered());
182  }

◆ testPass()

ilTestEvaluationPassDataTest::testPass ( )

Definition at line 86 of file ilTestEvaluationPassDataTest.php.

86  : void
87  {
88  $this->testObj->setPass(20);
89  $this->assertEquals(20, $this->testObj->getPass());
90  }

◆ testQuestionCount()

ilTestEvaluationPassDataTest::testQuestionCount ( )

Definition at line 74 of file ilTestEvaluationPassDataTest.php.

74  : void
75  {
76  $this->testObj->setQuestionCount(20);
77  $this->assertEquals(20, $this->testObj->getQuestionCount());
78  }

◆ testReachedPoints()

ilTestEvaluationPassDataTest::testReachedPoints ( )

Definition at line 62 of file ilTestEvaluationPassDataTest.php.

62  : void
63  {
64  $this->testObj->setReachedPoints(20);
65  $this->assertEquals(20, $this->testObj->getReachedPoints());
66  }

◆ testRequestedHintsCount()

ilTestEvaluationPassDataTest::testRequestedHintsCount ( )

Definition at line 163 of file ilTestEvaluationPassDataTest.php.

163  : void
164  {
165  $this->testObj->setRequestedHintsCount(5);
166 
167  $this->assertEquals(5, $this->testObj->getRequestedHintsCount());
168  }

◆ testWorkingTime()

ilTestEvaluationPassDataTest::testWorkingTime ( )

Definition at line 80 of file ilTestEvaluationPassDataTest.php.

80  : void
81  {
82  $this->testObj->setWorkingTime(20);
83  $this->assertEquals(20, $this->testObj->getWorkingTime());
84  }

Field Documentation

◆ $testObj

ilTestEvaluationPassData ilTestEvaluationPassDataTest::$testObj
private

Definition at line 27 of file ilTestEvaluationPassDataTest.php.


The documentation for this class was generated from the following file: