ILIAS  release_8 Revision v8.23
ToastClientHtmlTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ToastClientHtmlTest:
+ Collaboration diagram for ToastClientHtmlTest:

Public Member Functions

 getUIFactory ()
 
 getToastFactory ()
 
 getIconFactory ()
 
 testRenderClientHtml ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 25 of file ToastClientHtmlTest.php.

Member Function Documentation

◆ getIconFactory()

ToastClientHtmlTest::getIconFactory ( )

Definition at line 44 of file ToastClientHtmlTest.php.

Referenced by testRenderClientHtml().

45  {
47  }
This is how the factory for UI elements looks.
Definition: Factory.php:37
+ Here is the caller graph for this function:

◆ getToastFactory()

ToastClientHtmlTest::getToastFactory ( )

Definition at line 37 of file ToastClientHtmlTest.php.

Referenced by testRenderClientHtml().

38  {
40  $this->createMock(ILIAS\UI\Implementation\Component\SignalGenerator::class)
41  );
42  }
Class Factory.
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getUIFactory()

ToastClientHtmlTest::getUIFactory ( )

Definition at line 27 of file ToastClientHtmlTest.php.

27  : NoUIFactory
28  {
29  return new class () extends NoUIFactory {
30  public function button(): C\Button\Factory
31  {
32  return new I\Component\Button\Factory();
33  }
34  };
35  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21

◆ testRenderClientHtml()

ToastClientHtmlTest::testRenderClientHtml ( )

Definition at line 49 of file ToastClientHtmlTest.php.

References $container, ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), getIconFactory(), getToastFactory(), and ILIAS\UI\examples\MainControls\Slate\Notification\standard().

49  : void
50  {
51  $expected_html = file_get_contents(__DIR__ . "/../../Client/Toast/ToastTest.html");
52 
53  $rendered_html = '<head>
54  <title>Toast Test HTML</title>
55  <script src="../../../../src/UI/templates/js/Toast/toast.js"></script>
56  <script>document.il = il</script>
57  </head>
58  <body>
59  {CONTAINER}
60  </body>';
61 
62  $container = $this->getToastFactory()->container()->withAdditionalToast(
63  $this->getToastFactory()->standard(
64  'Title',
65  $this->getIconFactory()->standard('mail', 'Test')
66  )
67  ->withVanishTime(5000)
68  ->withDelayTime(500)
69  ->withDescription('Description')
70  ->withAction('https://www.ilias.de')
71  );
72 
73  $rendered_html = str_replace('{CONTAINER}', $this->getDefaultRenderer()->render($container), $rendered_html);
74  $rendered_html = preg_replace('/id=".*?"/', '', $rendered_html);
75 
76  $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($rendered_html));
77  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
standard()
This is an example, of how the Notification Slate is generated by assigning Notification Items to it...
Definition: standard.php:16
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:444
$container
Definition: wac.php:14
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: