ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ModalBase.php
Go to the documentation of this file.
1<?php
2require_once(__DIR__ . "/../../../../libs/composer/vendor/autoload.php");
3require_once(__DIR__ . "/../../Base.php");
4
5use \ILIAS\UI\Component as C;
6use \ILIAS\UI\Implementation as I;
7
13abstract class ModalBase extends ILIAS_UI_TestBase
14{
15 public function getUIFactory()
16 {
17 return new \ILIAS\UI\Implementation\Factory(
18 new I\Component\Counter\Factory(),
19 $this->createMock(C\Glyph\Factory::class),
20 $this->createMock(C\Button\Factory::class),
21 $this->createMock(C\Listing\Factory::class),
22 $this->createMock(C\Image\Factory::class),
23 $this->createMock(C\Panel\Factory::class),
24 $this->createMock(C\Modal\Factory::class),
25 $this->createMock(C\Dropzone\Factory::class),
26 $this->createMock(C\Popover\Factory::class),
27 $this->createMock(C\Divider\Factory::class),
28 $this->createMock(C\Link\Factory::class),
29 $this->createMock(C\Dropdown\Factory::class),
30 $this->createMock(C\Item\Factory::class),
31 $this->createMock(C\Icon\Factory::class),
32 $this->createMock(C\ViewControl\Factory::class),
33 $this->createMock(C\Chart\Factory::class),
34 $this->createMock(C\Input\Factory::class),
35 $this->createMock(C\Table\Factory::class),
36 $this->createMock(C\MessageBox\Factory::class),
37 $this->createMock(C\Card\Factory::class)
38 );
39 }
40
41 protected function getModalFactory()
42 {
43 return new I\Component\Modal\Factory(new SignalGeneratorMock());
44 }
45
46 protected function getButtonFactory()
47 {
48 return new \ILIAS\UI\Implementation\Component\Button\Factory();
49 }
50
51 protected function getDummyComponent()
52 {
53 return new DummyComponent();
54 }
55
56 public function normalizeHTML($html)
57 {
58 $html = parent::normalizeHTML($html);
59 // The times entity is used for closing the modal and not supported in DomDocument::loadXML()
60 return str_replace(['&times;', "\t"], ['', ''], $html);
61 }
62}
An exception for terminatinating execution or to throw for unit testing.
Provides common functionality for UI tests.
Definition: Base.php:192
Base class for modal tests.
Definition: ModalBase.php:14
getButtonFactory()
Definition: ModalBase.php:46
normalizeHTML($html)
Definition: ModalBase.php:56
getUIFactory()
Definition: ModalBase.php:15
getModalFactory()
Definition: ModalBase.php:41
getDummyComponent()
Definition: ModalBase.php:51
$html
Definition: example_001.php:87