ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUITest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
26 {
29 
30  protected function setUp(): void
31  {
32  parent::setUp();
33 
34  $lng_mock = $this->createMock(ilLanguage::class);
35  $lng_mock->expects($this->any())
36  ->method("txt")
37  ->willReturnCallback(function () {
38  return "testTranslation";
39  });
40 
41  $ctrl_mock = $this->createMock(ilCtrl::class);
42  $ctrl_mock->expects($this->any())
43  ->method("getFormAction")
44  ->willReturnCallback(function () {
45  return "testFormAction";
46  });
47 
48  $objTest_mock = $this->createMock(ilObjTest::class);
49  $objTest_mock->expects($this->any())
50  ->method("getTestQuestions")
51  ->willReturnCallback(function () {
52  return [];
53  });
54  $objTest_mock->expects($this->any())
55  ->method("getPotentialRandomTestQuestions")
56  ->willReturnCallback(function () {
57  return [];
58  });
59 
60  $this->setGlobalVariable("lng", $lng_mock);
61  $this->setGlobalVariable("ilCtrl", $ctrl_mock);
62  $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
63  $this->setGlobalVariable("component.repository", $this->createMock(ilComponentRepository::class));
64  $component_factory = $this->createMock(ilComponentFactory::class);
65  $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
66  $this->setGlobalVariable("component.factory", $component_factory);
67  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
68 
69  $this->parentObj_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(array('getObject'))->getMock();
70  $this->parentObj_mock->expects($this->any())->method('getObject')->willReturn($objTest_mock);
71 
72  $this->tableGui = new ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI($this->parentObj_mock, "");
73  }
74 
76  {
77  $this->assertInstanceOf(ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI::class, $this->tableGui);
78  }
79 }
Class ilObjTestGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setGlobalVariable(string $name, $value)
Class ilTestBaseClass.