ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
DividerTest Class Reference

Test on divider implementation. More...

+ Inheritance diagram for DividerTest:
+ Collaboration diagram for DividerTest:

Public Member Functions

 getFactory ()
 
 test_implements_factory_interface ()
 
 test_with_label ()
 
 test_render_horizontal_empty ()
 
 test_render_horizontal_with_label ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Detailed Description

Test on divider implementation.

Definition at line 13 of file DividerTest.php.

Member Function Documentation

◆ getFactory()

DividerTest::getFactory ( )
Returns
\ILIAS\UI\Implementation\Factory

Definition at line 19 of file DividerTest.php.

20 {
21 return new \ILIAS\UI\Implementation\Factory();
22 }

Referenced by test_implements_factory_interface(), test_render_horizontal_empty(), test_render_horizontal_with_label(), and test_with_label().

+ Here is the caller graph for this function:

◆ test_implements_factory_interface()

DividerTest::test_implements_factory_interface ( )

Definition at line 24 of file DividerTest.php.

25 {
26 $f = $this->getFactory();
27
28 $this->assertInstanceOf("ILIAS\\UI\\Component\\Divider\\Horizontal", $f->divider()->horizontal());
29 }

References getFactory().

+ Here is the call graph for this function:

◆ test_render_horizontal_empty()

DividerTest::test_render_horizontal_empty ( )

Definition at line 39 of file DividerTest.php.

40 {
41 $f = $this->getFactory();
42 $r = $this->getDefaultRenderer();
43
44 $c = $f->divider()->horizontal();
45
46 $html = trim($r->render($c));
47
48 $expected_html = "<hr/>";
49
50 $this->assertHTMLEquals($expected_html, $html);
51 }
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:252
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:216
$html
Definition: example_001.php:87
$r
Definition: example_031.php:79

References $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().

+ Here is the call graph for this function:

◆ test_render_horizontal_with_label()

DividerTest::test_render_horizontal_with_label ( )

Definition at line 53 of file DividerTest.php.

54 {
55 $f = $this->getFactory();
56 $r = $this->getDefaultRenderer();
57
58 $c = $f->divider()->horizontal()->withLabel("label");
59
60 $html = trim($r->render($c));
61 $expected_html = '<hr class="il-divider-with-label" /><h6 class="il-divider">label</h6>';
62
63 $this->assertHTMLEquals("<div>" . $expected_html . "</div>", "<div>" . $html . "</div>");
64 }

References $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().

+ Here is the call graph for this function:

◆ test_with_label()

DividerTest::test_with_label ( )

Definition at line 31 of file DividerTest.php.

32 {
33 $f = $this->getFactory();
34 $c = $f->divider()->horizontal()->withLabel("label");
35
36 $this->assertEquals($c->getLabel(), "label");
37 }

References getFactory().

+ Here is the call graph for this function:

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