ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 $factory = new class extends NoUIFactory {
18 public function counter()
19 {
20 return new I\Component\Counter\Factory();
21 }
22 public function legacy($content)
23 {
24 $f = new I\Component\Legacy\Factory(new I\Component\SignalGenerator());
25 return $f->legacy($content);
26 }
27 };
28 return $factory;
29 }
30
31 protected function getModalFactory()
32 {
33 return new I\Component\Modal\Factory(new SignalGeneratorMock());
34 }
35
36 protected function getButtonFactory()
37 {
38 return new \ILIAS\UI\Implementation\Component\Button\Factory();
39 }
40
41 protected function getDummyComponent()
42 {
43 return new DummyComponent();
44 }
45
46 public function normalizeHTML($html)
47 {
48 $html = parent::normalizeHTML($html);
49 // The times entity is used for closing the modal and not supported in DomDocument::loadXML()
50 return str_replace(['&times;', "\t"], ['', ''], $html);
51 }
52}
An exception for terminatinating execution or to throw for unit testing.
Provides common functionality for UI tests.
Definition: Base.php:225
Base class for modal tests.
Definition: ModalBase.php:14
getButtonFactory()
Definition: ModalBase.php:36
normalizeHTML($html)
Definition: ModalBase.php:46
getUIFactory()
Definition: ModalBase.php:15
getModalFactory()
Definition: ModalBase.php:31
getDummyComponent()
Definition: ModalBase.php:41
legacy()
Definition: legacy.php:3
$factory
Definition: metadata.php:58