ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 getHelpTextRetriever ()
 
 getUploadLimitResolver ()
 
 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 26 of file ToastClientHtmlTest.php.

Member Function Documentation

◆ getIconFactory()

ToastClientHtmlTest::getIconFactory ( )

Definition at line 45 of file ToastClientHtmlTest.php.

Referenced by testRenderClientHtml().

46  {
48  }
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 38 of file ToastClientHtmlTest.php.

Referenced by testRenderClientHtml().

39  {
41  $this->createMock(ILIAS\UI\Implementation\Component\SignalGenerator::class)
42  );
43  }
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 28 of file ToastClientHtmlTest.php.

References ILIAS\Repository\button().

28  : NoUIFactory
29  {
30  return new class () extends NoUIFactory {
31  public function button(): C\Button\Factory
32  {
33  return new I\Component\Button\Factory();
34  }
35  };
36  }
button(string $caption, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ testRenderClientHtml()

ToastClientHtmlTest::testRenderClientHtml ( )

Definition at line 50 of file ToastClientHtmlTest.php.

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

50  : void
51  {
52  $expected_html = file_get_contents(__DIR__ . "/../../Client/Toast/ToastTest.html");
53 
54  $rendered_html = '<head>
55  <title>Toast Test HTML</title>
56  <script src="../../../../src/UI/templates/js/Toast/toast.js"></script>
57  <script>document.il = il</script>
58  </head>
59  <body>
60  {CONTAINER}
61  </body>';
62 
63  $container = $this->getToastFactory()->container()->withAdditionalToast(
64  $this->getToastFactory()->standard(
65  'Title',
66  $this->getIconFactory()->standard('mail', 'Test')
67  )
68  ->withDescription('Description')
69  ->withAction('https://www.ilias.de')
70  );
71 
72  $rendered_html = str_replace('{CONTAINER}', $this->getDefaultRenderer()->render($container), $rendered_html);
73  $rendered_html = preg_replace('/id=".*?"/', '', $rendered_html);
74 
75  $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($rendered_html));
76  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
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:475
$container
Definition: wac.php:14
+ Here is the call graph for this function:

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