ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestHistoryTableGUITest.php
Go to the documentation of this file.
1 <?php
18 declare(strict_types=1);
19 
25 {
28 
29  protected function setUp(): void
30  {
31  parent::setUp();
32 
33  $lng_mock = $this->createMock(ilLanguage::class);
34  $ctrl_mock = $this->createMock(ilCtrl::class);
35  $ctrl_mock->expects($this->any())
36  ->method("getFormAction")
37  ->willReturnCallback(function () {
38  return "testFormAction";
39  });
40 
41  $this->setGlobalVariable("lng", $lng_mock);
42  $this->setGlobalVariable("ilCtrl", $ctrl_mock);
43  $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
44  $this->setGlobalVariable("component.repository", $this->createMock(ilComponentRepository::class));
45  $component_factory = $this->createMock(ilComponentFactory::class);
46  $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
47  $this->setGlobalVariable("component.factory", $component_factory);
48  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
49 
50  $this->parentObj_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(array('getObject'))->getMock();
51  $this->parentObj_mock->expects($this->any())->method('getObject')->willReturn($this->createMock(ilObjTest::class));
52  $this->tableGui = new ilTestHistoryTableGUI($this->parentObj_mock, "");
53  }
54 
56  {
57  $this->assertInstanceOf(ilTestHistoryTableGUI::class, $this->tableGui);
58  }
59 }
Class ilObjTestGUI.
setGlobalVariable(string $name, $value)
Class ilTestBaseClass.
Class ilTestHistoryTableGUITest.