ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SettingsScoringGUITest.php
Go to the documentation of this file.
1 <?php
2 
22 
29 {
30  use UITestHelper;
31 
32  protected function getUIComponents(): array
33  {
34  return [
35  $this->factory(),
36  $this->renderer(),
37  $this->createMock(ServerRequestInterface::class),
38  $this->getMockBuilder(\ILIAS\Refinery\Factory::class)->disableOriginalConstructor()->getMock(),
39  $this->mainTemplate(),
40  $this->createMock(ilTabsGUI::class)
41  ];
42  }
43 
44 
45  public function testScoringResultsGUIConstruct(): void
46  {
47  $objTestGui_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(['getObject'])->getMock();
48  $objTestGui_mock->expects(
49  $this->any()
50  )->method('getObject')->willReturn(
51  $this->getTestObjMock()
52  );
53 
54  [$ui_factory, $ui_renderer, $request, $refinery, $main_template, $tabs_gui] = $this->getUIComponents();
55 
56  $testObj = new SettingsScoringGUI(
57  $this->createMock(ilCtrl::class),
58  $this->createMock(ilAccessHandler::class),
59  $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock(),
60  $this->getMockBuilder(ilTree::class)->disableOriginalConstructor()->getMock(),
61  $this->createMock(ilDBInterface::class),
62  $this->createMock(ilComponentRepository::class),
63  $objTestGui_mock,
64  $main_template,
65  $tabs_gui,
66  $this->createMock(\ILIAS\Test\Logging\TestLogger::class),
67  $this->createMock(ScoreSettingsRepository::class),
68  -123,
69  $ui_factory,
70  $ui_renderer,
71  $refinery,
72  $request,
73  $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock(),
74  );
75 
76  $this->assertInstanceOf(SettingsScoringGUI::class, $testObj);
77  }
78 }
Interface Observer Contains several chained tasks and infos about them.
factory()
renderer()
Class SettingsScoringGUITest.
trait UITestHelper
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...
mainTemplate()