ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMarkSchemaTableGUITest.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  $ctrl_mock = $this->createMock(ilCtrl::class);
36  $ctrl_mock->expects($this->any())
37  ->method("getFormAction")
38  ->willReturnCallback(function () {
39  return "testFormAction";
40  });
41 
42  $this->setGlobalVariable("lng", $lng_mock);
43  $this->setGlobalVariable("ilCtrl", $ctrl_mock);
44  $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
45  $this->setGlobalVariable("component.repository", $this->createMock(ilComponentRepository::class));
46  $component_factory = $this->createMock(ilComponentFactory::class);
47  $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
48  $this->setGlobalVariable("component.factory", $component_factory);
49  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
50  $this->setGlobalVariable("ilToolbar", $this->createMock(ilToolbarGUI::class));
51 
52  $this->parentObj_mock = $this->createMock(ilMarkSchemaGUI::class);
53 
54  $assMarkSchema = $this->createMock(ASS_MarkSchema::class);
55  $assMarkSchema->expects($this->any())
56  ->method("getMarkSteps")
57  ->willReturn([]);
58 
59  $markSchemaAware_mock = $this->createMock(ilMarkSchemaAware::class);
60  $markSchemaAware_mock
61  ->expects($this->any())
62  ->method("getMarkSchema")
63  ->willReturn($assMarkSchema);
64  $this->tableGui = new ilMarkSchemaTableGUI(
65  $this->parentObj_mock,
66  "",
67  "",
68  $markSchemaAware_mock
69  );
70  }
71 
73  {
74  $this->assertInstanceOf(ilMarkSchemaTableGUI::class, $this->tableGui);
75  }
76 }
setGlobalVariable(string $name, $value)
Class ilTestBaseClass.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...