ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
CounterClientHtmlTest 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 CounterClientHtmlTest:
+ Collaboration diagram for CounterClientHtmlTest:

Public Member Functions

 getGlyphFactory ()
 
 getCounterFactory ()
 
 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 Checks if the HTML used for the Client tests is rendered as specified

Definition at line 28 of file CounterClientHtmlTest.php.

Member Function Documentation

◆ getCounterFactory()

CounterClientHtmlTest::getCounterFactory ( )

Definition at line 35 of file CounterClientHtmlTest.php.

36 {
37 return new \ILIAS\UI\Implementation\Component\Counter\Factory();
38 }

Referenced by testRenderClientHtml().

+ Here is the caller graph for this function:

◆ getGlyphFactory()

CounterClientHtmlTest::getGlyphFactory ( )

Definition at line 30 of file CounterClientHtmlTest.php.

31 {
32 return new \ILIAS\UI\Implementation\Component\Symbol\Glyph\Factory();
33 }

Referenced by testRenderClientHtml().

+ Here is the caller graph for this function:

◆ testRenderClientHtml()

CounterClientHtmlTest::testRenderClientHtml ( )

Definition at line 40 of file CounterClientHtmlTest.php.

40 : void
41 {
42 $counter_factory = $this->getCounterFactory();
43 $expected_html = file_get_contents(__DIR__ . "/../../Client/Counter/CounterTest.html");
44
45 $rendered_html = '
46 <div>
47 <div id="testEmpty">
48 </div>
49 <div id="test1">
50 RENDERED_HTML_OF_TEST_1
51 </div>
52
53 <div id="test2">
54 RENDERED_HTML_OF_TEST_2
55 </div>
56 </div>';
57
58
59 $add_glpyh = $this->getGlyphFactory()->add("");
60 $glyph_with_counter = $add_glpyh->withCounter($counter_factory->status(1))
61 ->withCounter($counter_factory->novelty(5));
62
63 $r = $this->getDefaultRenderer();
64 $rendered_html_of_test_1 = $r->render($glyph_with_counter);
65 $rendered_html_of_test_2 = $rendered_html_of_test_1 . $rendered_html_of_test_1;
66
67 $rendered_html = str_replace("RENDERED_HTML_OF_TEST_1", $rendered_html_of_test_1, $rendered_html);
68 $rendered_html = str_replace("RENDERED_HTML_OF_TEST_2", $rendered_html_of_test_2, $rendered_html);
69
70 $this->assertHTMLEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($rendered_html));
71 }

References getCounterFactory(), and getGlyphFactory().

+ Here is the call graph for this function:

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