ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 

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 ( )

◆ getToastFactory()

ToastClientHtmlTest::getToastFactory ( )

Definition at line 38 of file ToastClientHtmlTest.php.

39 {
41 $this->createMock(ILIAS\UI\Implementation\Component\SignalGenerator::class)
42 );
43 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

Referenced by testRenderClientHtml().

+ Here is the caller graph for this function:

◆ getUIFactory()

ToastClientHtmlTest::getUIFactory ( )

Definition at line 28 of file ToastClientHtmlTest.php.

29 {
30 return new class () extends NoUIFactory {
31 public function button(): I\Component\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...
Definition: Bulky.php:21

References ILIAS\Repository\button().

+ Here is the call graph for this function:

◆ testRenderClientHtml()

ToastClientHtmlTest::testRenderClientHtml ( )

Definition at line 50 of file ToastClientHtmlTest.php.

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="../../../resources/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 }
withAction(URI|Signal|string $action)
$container
@noRector
Definition: wac.php:37

References $container, getIconFactory(), getToastFactory(), ILIAS\UI\examples\MainControls\Slate\Notification\standard(), and ILIAS\GlobalScreen\Scope\Footer\Factory\withAction().

+ Here is the call graph for this function:

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