ILIAS  release_8 Revision v8.24
ilSystemStyleLessGUITest.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
24use Psr\Http\Message\ServerRequestInterface;
25use ILIAS\Data\Factory as DataFactory;
26use ILIAS\Refinery\Factory as Refinery;
30
32{
34
35 protected function setUp(): void
36 {
37 parent::setUp();
38 $ui_helper = new UITestHelper();
39
40 $ctrl = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->onlyMethods([
41 'getFormAction'
42 ])->getMock();
43 $lng = new ilLanguageMock();
44 $tpl = $ui_helper->mainTemplate();
45 $ui_factory = $ui_helper->factory();
46 $renderer = $ui_helper->renderer();
47 $request = $this->getMockBuilder(ServerRequestInterface::class)->disableOriginalConstructor()->onlyMethods([
48 ])->getMock();
49
50 $toolbar = $this->getMockBuilder(ilToolbarGUI::class)->disableOriginalConstructor()->onlyMethods([])->getMock();
51 $data_factory = new DataFactory();
52 $refinery = new Refinery($data_factory, $lng);
53
54 $factory = new ilSkinFactory($this->lng, $this->system_style_config);
55
56 $this->less_gui = new ilSystemStyleLessGUI(
57 $ctrl,
58 $lng,
59 $tpl,
60 $ui_factory,
61 $renderer,
62 $request,
63 $toolbar,
66 $this->container->getSkin()->getId(),
67 $this->style->getId()
68 );
69 }
70
71 public function testConstruct(): void
72 {
73 $this->assertInstanceOf(ilSystemStyleLessGUI::class, $this->less_gui);
74 }
75
76 public function testInitSystemStyleLessForm(): void
77 {
78 $form = $this->less_gui->initSystemStyleLessForm();
79
80 $this->assertInstanceOf(Form::class, $form);
81 $this->assertCount(1, $form->getInputs());
82 $this->assertInstanceOf(Section::class, $form->getInputs()[0]);
83 $this->assertCount(2, $form->getInputs()[0]->getInputs());
84 $this->assertInstanceOf(Section::class, $form->getInputs()[0]->getInputs()[0]);
85 $this->assertCount(3, $form->getInputs()[0]->getInputs()[0]->getInputs());
86 $this->assertInstanceOf(Text::class, $form->getInputs()[0]->getInputs()[0]->getInputs()[0]);
87 }
88}
Builds data types.
Definition: Factory.php:21
This implements the section input.
Definition: Section.php:29
This implements the text input.
Definition: Text.php:32
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...
Factory to create Skin classes holds an manages the basic data of a skin as provide by the template o...
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