ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ModalBase.php
Go to the documentation of this file.
1 <?php
2 require_once(__DIR__ . "/../../../../libs/composer/vendor/autoload.php");
3 require_once(__DIR__ . "/../../Base.php");
4 
5 use \ILIAS\UI\Component as C;
6 use \ILIAS\UI\Implementation as I;
7 
13 abstract 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 }
getButtonFactory()
Definition: ModalBase.php:46
getUIFactory()
Definition: ModalBase.php:15
getDummyComponent()
Definition: ModalBase.php:51
normalizeHTML($html)
Definition: ModalBase.php:56
Provides common functionality for UI tests.
Definition: Base.php:191
Base class for modal tests.
Definition: ModalBase.php:13
getModalFactory()
Definition: ModalBase.php:41
$html
Definition: example_001.php:87