ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestEvaluationPassDataTest Class Reference

Class ilTestEvaluationPassDataTest. 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 ()
 
 testExamId ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 

Private Attributes

ilTestEvaluationPassData $testObj
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTestBaseTestCase
static callMethod ($obj, $name, array $args=[])
 
- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 

Detailed Description

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 98 of file ilTestEvaluationPassDataTest.php.

References null.

98  : void
99  {
100  $expected = [
101  ['id' => 20, 'points' => 2.5, 'reached' => 1.5, 'isAnswered' => true, 'sequence' => null, 'manual' => 0],
102  ['id' => 12, 'points' => 12.5, 'reached' => 11, 'isAnswered' => true, 'sequence' => null, 'manual' => 1],
103  ['id' => 165, 'points' => -5.5, 'reached' => 0, 'isAnswered' => false, 'sequence' => null, 'manual' => 0],
104  ['id' => 4, 'points' => 55.5, 'reached' => 200, 'isAnswered' => false, 'sequence' => null, 'manual' => 1]
105  ];
106 
107  foreach ($expected as $value) {
108  $this->testObj->addAnsweredQuestion(
109  $value['id'],
110  $value['points'],
111  $value['reached'],
112  $value['isAnswered'],
113  $value['sequence'],
114  $value['manual']
115  );
116  }
117 
118  $this->assertEquals($expected, $this->testObj->getAnsweredQuestions());
119 
120  foreach ($expected as $key => $value) {
121  $this->assertEquals($value, $this->testObj->getAnsweredQuestion($key));
122  }
123  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testDeductedHintPoints()

ilTestEvaluationPassDataTest::testDeductedHintPoints ( )

Definition at line 180 of file ilTestEvaluationPassDataTest.php.

180  : void
181  {
182  $deductedHintPoints = 5;
183  $this->testObj->setDeductedHintPoints($deductedHintPoints);
184 
185  $this->assertEquals($deductedHintPoints, $this->testObj->getDeductedHintPoints());
186  }

◆ testExamId()

ilTestEvaluationPassDataTest::testExamId ( )

Definition at line 188 of file ilTestEvaluationPassDataTest.php.

188  : void
189  {
190  $exam_id = '5';
191  $this->testObj->setExamId($exam_id);
192 
193  $this->assertEquals($exam_id, $this->testObj->getExamId());
194  }

◆ testGetAnsweredQuestionByQuestionId()

ilTestEvaluationPassDataTest::testGetAnsweredQuestionByQuestionId ( )

Definition at line 125 of file ilTestEvaluationPassDataTest.php.

References null.

125  : void
126  {
127  $expected = [
128  ['id' => 20, 'points' => 2.5, 'reached' => 1.5, 'isAnswered' => true, 'sequence' => null, 'manual' => 0],
129  ['id' => 12, 'points' => 12.5, 'reached' => 11, 'isAnswered' => true, 'sequence' => null, 'manual' => 1],
130  ['id' => 165, 'points' => -5.5, 'reached' => 0, 'isAnswered' => false, 'sequence' => null, 'manual' => 0],
131  ['id' => 4, 'points' => 55.5, 'reached' => 200, 'isAnswered' => false, 'sequence' => null, 'manual' => 1]
132  ];
133  foreach ($expected as $value) {
134  $this->testObj->addAnsweredQuestion(
135  $value['id'],
136  $value['points'],
137  $value['reached'],
138  $value['isAnswered'],
139  $value['sequence'],
140  $value['manual']
141  );
142  }
143 
144  foreach ($expected as $value) {
145  $this->assertEquals($value, $this->testObj->getAnsweredQuestionByQuestionId($value['id']));
146  }
147  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testGetAnsweredQuestionCount()

ilTestEvaluationPassDataTest::testGetAnsweredQuestionCount ( )

Definition at line 149 of file ilTestEvaluationPassDataTest.php.

References null.

149  : void
150  {
151  $expected = [
152  ['id' => 20, 'points' => 2.5, 'reached' => 1.5, 'isAnswered' => true, 'sequence' => null, 'manual' => 0],
153  ['id' => 12, 'points' => 12.5, 'reached' => 11, 'isAnswered' => true, 'sequence' => null, 'manual' => 1],
154  ['id' => 165, 'points' => -5.5, 'reached' => 0, 'isAnswered' => false, 'sequence' => null, 'manual' => 0],
155  ['id' => 4, 'points' => 55.5, 'reached' => 200, 'isAnswered' => false, 'sequence' => null, 'manual' => 1]
156  ];
157 
158  foreach ($expected as $value) {
159  $this->testObj->addAnsweredQuestion(
160  $value['id'],
161  $value['points'],
162  $value['reached'],
163  $value['isAnswered'],
164  $value['sequence'],
165  $value['manual']
166  );
167  }
168 
169  $this->assertEquals(count($expected), $this->testObj->getAnsweredQuestionCount());
170  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testMaxPoints()

ilTestEvaluationPassDataTest::testMaxPoints ( )

Definition at line 70 of file ilTestEvaluationPassDataTest.php.

70  : void
71  {
72  $maxpoints = 20;
73  $this->testObj->setMaxPoints($maxpoints);
74  $this->assertEquals($maxpoints, $this->testObj->getMaxPoints());
75  }

◆ testNrOfAnsweredQuestions()

ilTestEvaluationPassDataTest::testNrOfAnsweredQuestions ( )

Definition at line 56 of file ilTestEvaluationPassDataTest.php.

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

◆ testPass()

ilTestEvaluationPassDataTest::testPass ( )

Definition at line 91 of file ilTestEvaluationPassDataTest.php.

91  : void
92  {
93  $pass = 20;
94  $this->testObj->setPass($pass);
95  $this->assertEquals($pass, $this->testObj->getPass());
96  }

◆ testQuestionCount()

ilTestEvaluationPassDataTest::testQuestionCount ( )

Definition at line 77 of file ilTestEvaluationPassDataTest.php.

77  : void
78  {
79  $questioncount = 20;
80  $this->testObj->setQuestionCount($questioncount);
81  $this->assertEquals($questioncount, $this->testObj->getQuestionCount());
82  }

◆ testReachedPoints()

ilTestEvaluationPassDataTest::testReachedPoints ( )

Definition at line 63 of file ilTestEvaluationPassDataTest.php.

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

◆ testRequestedHintsCount()

ilTestEvaluationPassDataTest::testRequestedHintsCount ( )

Definition at line 172 of file ilTestEvaluationPassDataTest.php.

172  : void
173  {
174  $requestedHintsCount = 5;
175  $this->testObj->setRequestedHintsCount($requestedHintsCount);
176 
177  $this->assertEquals($requestedHintsCount, $this->testObj->getRequestedHintsCount());
178  }

◆ testWorkingTime()

ilTestEvaluationPassDataTest::testWorkingTime ( )

Definition at line 84 of file ilTestEvaluationPassDataTest.php.

84  : void
85  {
86  $workingtime = 20;
87  $this->testObj->setWorkingTime($workingtime);
88  $this->assertEquals($workingtime, $this->testObj->getWorkingTime());
89  }

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: