ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSystemStyleLessGUITest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 require_once('libs/composer/vendor/autoload.php');
22 include_once('./tests/UI/UITestHelper.php');
23 
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,
64  $refinery,
65  $factory,
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 }
Factory to create Skin classes holds an manages the basic data of a skin as provide by the template o...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...
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