ILIAS  release_8 Revision v8.24
ilSystemStyleIconsGUITest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once('libs/composer/vendor/autoload.php');
22include_once('./tests/UI/UITestHelper.php');
23
25use ILIAS\Data\Factory as DataFactory;
26use ILIAS\Refinery\Factory as Refinery;
28
30{
32
33 protected ilCtrl $ctrl;
34
35 protected function setUp(): void
36 {
37 parent::setUp();
38 $ui_helper = new UITestHelper();
39
40 $this->ctrl = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->onlyMethods([
41 'getFormAction','getCmd','getLinkTargetByClass'
42 ])->getMock();
43
44 $tpl = $ui_helper->mainTemplate();
45 $ui_factory = $ui_helper->factory();
46 $renderer = $ui_helper->renderer();
47 $request = $this->getMockBuilder(WrapperFactory::class)->disableOriginalConstructor()->onlyMethods([
48 ])->getMock();
49
50 $toolbar = $this->getMockBuilder(ilToolbarGUI::class)->disableOriginalConstructor()->onlyMethods([])->getMock();
51 $upload = $this->getMockBuilder(FileUpload::class)->disableOriginalConstructor()->onlyMethods([])->getMock();
52 $tabs = $this->getMockBuilder(ilTabsGUI::class)->disableOriginalConstructor()->onlyMethods([])->getMock();
53 $data_factory = new DataFactory();
54 $refinery = new Refinery($data_factory, $this->lng);
55
56 $factory = new ilSkinFactory($this->lng, $this->system_style_config);
57
58 $this->icons_gui = new ilSystemStyleIconsGUI(
59 $this->ctrl,
60 $this->lng,
61 $tpl,
62 $ui_factory,
63 $renderer,
64 $request,
65 $toolbar,
68 $tabs,
69 $upload,
70 $this->container->getSkin()->getId(),
71 $this->style->getId()
72 );
73 }
74
75 public function testConstruct(): void
76 {
77 $this->ctrl->method('getCmd')->willReturn('');
78 $this->assertInstanceOf(ilSystemStyleIconsGUI::class, $this->icons_gui);
79 }
80
81 public function tesGetIconsPreviewstPreview(): void
82 {
83 $this->assertInstanceOf(\ILIAS\UI\Component\Panel\Report::class, $this->icons_gui->getIconsPreviews());
84 }
85
86 //this is only a smoke test
87 public function testPreview(): void
88 {
89 $this->ctrl->method('getCmd')->willReturn('preview');
90 $this->icons_gui->executeCommand();
91 $this->assertTrue(true);
92 }
93}
Builds data types.
Definition: Factory.php:21
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...
Class ilCtrl provides processing control methods.
Factory to create Skin classes holds an manages the basic data of a skin as provide by the template o...
@ilCtrl_Calls ilSystemStyleIconsGUI:
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$factory
Definition: metadata.php:75
Refinery Factory $refinery
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.