76 : void
77 {
78 $records = [];
79 $records[] = [
80 "active_id" => 7 ,
81 "question_fi" => 9,
82 "result_points" => 1.2,
83 "answered" => true,
84 "manual" => 1,
85 "original_id" => null,
86 "questiontitle" => "some title",
87 "qpl_maxpoints" => 2.4,
88 "submitted" => true,
89 "last_finished_pass" => 1,
90 "pass" => 1,
91 "points" => 10.3,
92 "maxpoints" => 32,
93 "questioncount" => 32,
94 "answeredquestions" => 1,
95 "workingtime" => 28,
96 "tstamp" => 1731941437,
97 "obligations_answered" => true,
98 "exam_id" => "I0_T355_A7_P1",
99 "usr_id" => 6,
100 "firstname" => "root",
101 "lastname" => "user",
102 "title" => "",
103 "login" => "root",
104 "finalized_by" => null
105 ];
106 $records[] = ['first_access' => '2024-12-11 17:54:26'];
107 $records[] = null;
108
109 $test_obj = $this->createMock(ilObjTest::class);
110 $test_obj
111 ->expects($this->once())
112 ->method('getPassScoring');
113 $test_obj
114 ->expects($this->once())
115 ->method('getAccessFilteredParticipantList')
116 ->willReturn(null);
117 $test_obj
118 ->expects($this->once())
119 ->method('getTestParticipants')
120 ->willReturn([7]);
121 $test_obj
122 ->expects($this->once())
123 ->method('getVisitingTimeOfParticipant')
124 ->willReturn(
125 [
126 'first_access' => new \DateTimeImmutable(),
127 'last_access' => new \DateTimeImmutable()
128 ]
129 );
130
131 $db = $this->createMock(ilDBInterface::class);
132 $db
133 ->expects($this->exactly(3))
134 ->method('fetchAssoc')
135 ->willReturnCallback(
136 function (
$res) use (&$records) {
137 return array_shift($records);
138 }
139 );
140
142 $data = $factory->getEvaluationData();
143 $this->assertInstanceOf(ilTestEvaluationData::class,
$data);
144
145 $this->assertEquals(
146 [7],
147 $data->getParticipantIds()
148 );
149 $this->assertInstanceOf(
150 ilTestEvaluationUserData::class,
151 $data->getParticipant(7)
152 );
153 }