33 : void
34 {
35 parent::setUp();
36
37 $lng_mock = $this->createMock(ilLanguage::class);
38 $lng_mock->expects($this->any())
39 ->method("txt")
40 ->willReturnCallback(function () {
41 return "testTranslation";
42 });
43
44 $ctrl_mock = $this->createMock(ilCtrl::class);
45 $ctrl_mock->expects($this->any())
46 ->method("getFormAction")
47 ->willReturnCallback(function () {
48 return "testFormAction";
49 });
50
51 $access_mock = $this->createMock(ilTestAccess::class);
52 $access_mock->expects($this->exactly(1))
53 ->method("checkScoreParticipantsAccess")
54 ->willReturn(true);
55
59 $this->
setGlobalVariable(
"component.repository", $this->createMock(ilComponentRepository::class));
60 $component_factory = $this->createMock(ilComponentFactory::class);
61 $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
64
65 $this->parentObj_mock = $this->getMockBuilder(TestScoringByParticipantGUI::class)
66 ->disableOriginalConstructor()
67 ->onlyMethods(['getObject', 'getTestAccess'])
68 ->getMock();
69 $this->parentObj_mock->expects($this->any())->method(
'getObject')->willReturn($this->
getTestObjMock());
70 $this->parentObj_mock->expects($this->any())->method('getTestAccess')->willReturn($access_mock);
71
73 }
setGlobalVariable(string $name, mixed $value)