19 declare(strict_types=1);
33 protected function setUp(): void
37 $lng_mock = $this->createMock(ilLanguage::class);
38 $lng_mock->expects($this->any())
40 ->willReturnCallback(
function () {
41 return "testTranslation";
44 $ctrl_mock = $this->createMock(ilCtrl::class);
45 $ctrl_mock->expects($this->any())
46 ->method(
"getFormAction")
47 ->willReturnCallback(
function () {
48 return "testFormAction";
51 $access_mock = $this->createMock(ilTestAccess::class);
52 $access_mock->expects($this->exactly(1))
53 ->method(
"checkScoreParticipantsAccess")
59 $this->
setGlobalVariable(
"component.repository", $this->createMock(ilComponentRepository::class));
60 $component_factory = $this->createMock(ilComponentFactory::class);
61 $component_factory->method(
"getActivePluginsInSlot")->willReturn(
new ArrayIterator());
65 $this->parentObj_mock = $this->getMockBuilder(TestScoringByParticipantGUI::class)
66 ->disableOriginalConstructor()
67 ->onlyMethods([
'getObject',
'getTestAccess'])
69 $this->parentObj_mock->expects($this->any())->method(
'getObject')->willReturn($this->
getTestObjMock());
70 $this->parentObj_mock->expects($this->any())->method(
'getTestAccess')->willReturn($access_mock);
77 $this->assertInstanceOf(TestScoringByParticipantTableGUI::class, $this->tableGui);
TestScoringByParticipantTableGUI $tableGui
TestScoringByParticipantGUI $parentObj_mock
Class TestScoringByParticipantTableGUITest.
setGlobalVariable(string $name, mixed $value)
test_instantiateObject_shouldReturnInstance()