3 declare(strict_types=1);
37 return "2021-12-02 12:55:33";
58 $db = $this->createMock(ilDBInterface::class);
60 $this->assertInstanceOf(ilIndividualAssessmentMembersStorageDB::class, $obj);
73 .
" ,iassme.obj_id, iassme.usr_id, iassme.examiner_id, iassme.record, iassme.internal_note, iassme.notify" 74 .
" ,iassme.notification_ts, iassme.learning_progress, iassme.finalized,iassme.place" 75 .
" ,iassme.event_time, iassme.changer_id, iassme.change_time\n" 76 .
" FROM iass_members iassme" 77 .
" JOIN usr_data usr ON iassme.usr_id = usr.usr_id" 78 .
" LEFT JOIN usr_data ex ON iassme.examiner_id = ex.usr_id" 79 .
" LEFT JOIN usr_data ud ON iassme.changer_id = ud.usr_id" 80 .
" WHERE obj_id = 22";
83 $iass = $this->createMock(ilObjIndividualAssessment::class);
85 ->expects($this->once())
90 $db_statement = $this->createMock(ilDBStatement::class);
92 $db = $this->createMock(ilDBInterface::class);
94 ->expects($this->once())
100 ->expects($this->once())
103 ->willReturn($db_statement)
106 ->expects($this->any())
107 ->method(
"fetchAssoc")
108 ->with($db_statement)
113 $result = $obj->loadMembers($iass);
114 $this->assertInstanceOf(ilIndividualAssessmentMembers::class, $result);
122 .
"iassme.examiner_id," 124 .
"iassme.internal_note," 126 .
"iassme.notification_ts," 127 .
"iassme.learning_progress," 128 .
"iassme.finalized," 130 .
"iassme.event_time," 131 .
"iassme.user_view_file," 132 .
"iassme.file_name," 133 .
"iassme.changer_id," 134 .
"iassme.change_time," 135 .
"usr.login AS user_login," 136 .
"ex.login AS examiner_login" 138 .
" JOIN usr_data usr ON iassme.usr_id = usr.usr_id\n" 139 .
" LEFT JOIN usr_data ex ON iassme.examiner_id = ex.usr_id\n" 140 .
" WHERE obj_id = 22" 143 $iass = $this->createMock(ilObjIndividualAssessment::class);
145 ->expects($this->once())
150 $db_statement = $this->createMock(ilDBStatement::class);
152 $db = $this->createMock(ilDBInterface::class);
154 ->expects($this->once())
156 ->with(22,
"integer")
160 ->expects($this->once())
163 ->willReturn($db_statement)
166 ->expects($this->once())
167 ->method(
"fetchAssoc")
168 ->with($db_statement)
173 $result = $obj->loadMembersAsSingleObjects($iass);
175 $this->assertIsArray($result);
176 $this->assertEmpty($result);
184 .
"iassme.examiner_id," 186 .
"iassme.internal_note," 188 .
"iassme.notification_ts," 189 .
"iassme.learning_progress," 190 .
"iassme.finalized," 192 .
"iassme.event_time," 193 .
"iassme.user_view_file," 194 .
"iassme.file_name," 195 .
"iassme.changer_id," 196 .
"iassme.change_time," 197 .
"usr.login AS user_login," 198 .
"ex.login AS examiner_login" 200 .
" JOIN usr_data usr ON iassme.usr_id = usr.usr_id\n" 201 .
" LEFT JOIN usr_data ex ON iassme.examiner_id = ex.usr_id\n" 202 .
" WHERE obj_id = 22\n" 203 .
" AND iassme.usr_id = 33" 206 $iass = $this->createMock(ilObjIndividualAssessment::class);
208 ->expects($this->once())
213 $usr = $this->createMock(ilObjUser::class);
215 ->expects($this->once())
220 $db_statement = $this->createMock(ilDBStatement::class);
222 $db = $this->createMock(ilDBInterface::class);
224 ->expects($this->exactly(2))
226 ->withConsecutive([22,
"integer"], [33,
"integer"])
227 ->willReturnOnConsecutiveCalls(
"22",
"33")
230 ->expects($this->once())
233 ->willReturn($db_statement)
236 ->expects($this->once())
237 ->method(
"fetchAssoc")
238 ->with($db_statement)
244 $this->expectException(ilIndividualAssessmentException::class);
245 $this->expectExceptionMessage(
"invalid usr-obj combination");
246 $obj->loadMember($iass, $usr);
254 .
"iassme.examiner_id," 256 .
"iassme.internal_note," 258 .
"iassme.notification_ts," 259 .
"iassme.learning_progress," 260 .
"iassme.finalized," 262 .
"iassme.event_time," 263 .
"iassme.user_view_file," 264 .
"iassme.file_name," 265 .
"iassme.changer_id," 266 .
"iassme.change_time," 267 .
"usr.login AS user_login," 268 .
"ex.login AS examiner_login" 270 .
" JOIN usr_data usr ON iassme.usr_id = usr.usr_id\n" 271 .
" LEFT JOIN usr_data ex ON iassme.examiner_id = ex.usr_id\n" 272 .
" WHERE obj_id = 22\n" 273 .
" AND iassme.usr_id = 33" 276 $iass = $this->createMock(ilObjIndividualAssessment::class);
278 ->expects($this->once())
283 $usr = $this->createMock(ilObjUser::class);
285 ->expects($this->once())
290 $db_statement = $this->createMock(ilDBStatement::class);
292 $db = $this->createMock(ilDBInterface::class);
294 ->expects($this->exactly(2))
296 ->withConsecutive([22,
"integer"], [33,
"integer"])
297 ->willReturnOnConsecutiveCalls(
"22",
"33")
300 ->expects($this->once())
303 ->willReturn($db_statement)
306 ->expects($this->once())
307 ->method(
"fetchAssoc")
308 ->with($db_statement)
314 $this->expectException(ilIndividualAssessmentException::class);
315 $this->expectExceptionMessage(
"invalid usr-obj combination");
316 $obj->loadMember($iass, $usr);
321 $iass = $this->createMock(ilObjIndividualAssessment::class);
322 $usr = $this->createMock(ilObjUser::class);
324 ->expects($this->once())
325 ->method(
"getFullname")
326 ->willReturn(
"Full Name")
347 $db = $this->createMock(ilDBInterface::class);
350 $member = $obj->createAssessmentMemberWrapper($iass, $usr, $record);
352 $this->assertEquals(
"Full Name", $member->getGrading()->getName());
353 $this->assertEquals(11, $member->changerId());
354 $this->assertEquals(
"2021-12-02", $member->changeTime()->format(
"Y-m-d"));
355 $this->assertEquals(22, $member->examinerId());
356 $this->assertEquals(
$timestamp, $member->notificationTS());
357 $this->assertEquals(
$timestamp, $member->eventTime()->getTimestamp());
358 $this->assertEquals(
"record", $member->record());
359 $this->assertEquals(
"internal_note", $member->internalNote());
360 $this->assertEquals(
"file_name", $member->fileName());
361 $this->assertTrue($member->viewFile());
362 $this->assertEquals(33, $member->LPStatus());
363 $this->assertTrue($member->notify());
364 $this->assertTrue($member->finalized());
372 $member = $this->createMock(ilIndividualAssessmentMember::class);
374 ->expects($this->once())
375 ->method(
"assessmentId")
379 ->expects($this->once())
384 ->expects($this->once())
385 ->method(
"eventTime")
389 ->expects($this->once())
394 ->expects($this->once())
395 ->method(
"examinerId")
399 ->expects($this->once())
401 ->willReturn(
"record")
404 ->expects($this->once())
405 ->method(
"internalNote")
406 ->willReturn(
"internalNote")
409 ->expects($this->once())
411 ->willReturn(
"place")
414 ->expects($this->once())
419 ->expects($this->once())
420 ->method(
"finalized")
424 ->expects($this->once())
425 ->method(
"notificationTS")
429 ->expects($this->once())
431 ->willReturn(
"fileName")
434 ->expects($this->once())
439 ->expects($this->once())
440 ->method(
"changerId")
444 $db = $this->createMock(ilDBInterface::class);
448 "obj_id" => [
"integer", 11],
449 "usr_id" => [
"integer", 22]
469 ->expects($this->once())
471 ->with(
"iass_members", $values, $where)
475 $obj->updateMember($member);
480 $iass = $this->createMock(ilObjIndividualAssessment::class);
482 ->expects($this->once())
487 $sql =
"DELETE FROM iass_members WHERE obj_id = 22";
489 $db = $this->createMock(ilDBInterface::class);
491 ->expects($this->once())
493 ->with(22,
"integer")
497 ->expects($this->once())
498 ->method(
"manipulate")
503 $obj->deleteMembers($iass);
510 $iass = $this->createMock(ilObjIndividualAssessment::class);
512 ->expects($this->once())
517 $db = $this->createMock(ilDBInterface::class);
538 "obj_id" => [
"integer", 11],
541 ilIndividualAssessmentMembers::FIELD_NOTIFY => [
"integer",
true],
556 ->expects($this->once())
558 ->with(
"iass_members", $values)
561 $obj->insertMembersRecord($iass, $record);
566 $iass = $this->createMock(ilObjIndividualAssessment::class);
568 ->expects($this->once())
576 "DELETE FROM iass_members" . PHP_EOL
577 .
"WHERE obj_id = 11" . PHP_EOL
578 .
"AND usr_id = 22" . PHP_EOL
581 $db = $this->createMock(ilDBInterface::class);
583 ->expects($this->exactly(2))
585 ->withConsecutive([11,
"integer"], [22,
"integer"])
586 ->willReturnOnConsecutiveCalls(
"11",
"22")
589 ->expects($this->once())
590 ->method(
"manipulate")
595 $obj->removeMembersRecord($iass, $record);
603 " AND finalized = 0 AND examiner_id IS NULL\n" 607 " AND finalized = 0 AND examiner_id IS NOT NULL\n" 611 " AND finalized = 1 AND learning_progress = 2\n" 615 " AND finalized = 1 AND learning_progress = 3\n" 629 $db = $this->createMock(ilDBInterface::class);
631 $res = $obj->getWhereFromFilterWrapper($filter);
633 $this->assertEquals($result,
$res);
638 $db = $this->createMock(ilDBInterface::class);
643 $res = $obj->getOrderByFromSortWrapper($sort);
645 $this->assertEquals(
" ORDER BY test foo",
$res);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const FIELD_INTERNAL_NOTE
const FIELD_LEARNING_PROGRESS
const FIELD_CHANGER_FIRSTNAME
const FIELD_USER_VIEW_FILE
const LP_ASSESSMENT_NOT_COMPLETED
const FIELD_EXAMINER_FIRSTNAME
const FIELD_NOTIFICATION_TS
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
foreach($mandatory_scripts as $file) $timestamp
const FIELD_EXAMINER_LASTNAME
const FIELD_CHANGER_LASTNAME