ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestVerificationTableGUITest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
26 {
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
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  $this->setGlobalVariable("component.factory", $this->createMock(ilComponentFactory::class));
46  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
47  $this->setGlobalVariable("ilUser", $this->createMock(ilObjUser::class));
48 
49  $this->setGlobalVariable("ilLoggerFactory", new class () extends ilLoggerFactory {
50  public function __construct()
51  {
52  }
53 
54  public static function getRootLogger(): ilLogger
55  {
56  return new class () extends ilLogger {
57  public function __construct()
58  {
59  }
60 
61  public function write(string $a_message, $a_level = ilLogLevel::INFO): void
62  {
63  }
64 
65  public function info(string $a_message): void
66  {
67  }
68 
69  public function debug(string $a_message, array $a_context = array()): void
70  {
71  }
72  };
73  }
74 
75  public static function getLogger(string $a_component_id): ilLogger
76  {
77  return new class () extends ilLogger {
78  public function __construct()
79  {
80  }
81 
82  public function write(string $a_message, $a_level = ilLogLevel::INFO): void
83  {
84  }
85 
86  public function debug(string $a_message, array $a_context = array()): void
87  {
88  }
89  };
90  }
91  });
92 
93  $test_gui = $this->getMockBuilder(ilObjTestVerificationGUI::class)->disableOriginalConstructor()->getMock();
94  $this->tableGui = new ilTestVerificationTableGUI($test_gui);
95  }
96 
98  {
99  $this->assertInstanceOf(ilTestVerificationTableGUI::class, $this->tableGui);
100  }
101 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setGlobalVariable(string $name, $value)
Class ilTestBaseClass.
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...