ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
DividerTest Class Reference

Test on divider implementation. More...

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

Public Member Functions

 test_implements_factory_interface ()
 
 test_with_label ()
 
 test_render_horizontal_empty ()
 
 test_render_horizontal_with_label ()
 
 test_render_vertical ()
 
- 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)
 

Protected Member Functions

 getFactory ()
 

Detailed Description

Test on divider implementation.

Definition at line 14 of file DividerTest.php.

Member Function Documentation

◆ getFactory()

DividerTest::getFactory ( )
protected

Definition at line 16 of file DividerTest.php.

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

17  {
18  return new I\Component\Divider\Factory();
19  }
+ Here is the caller graph for this function:

◆ test_implements_factory_interface()

DividerTest::test_implements_factory_interface ( )

Definition at line 21 of file DividerTest.php.

References $f, and getFactory().

22  {
23  $f = $this->getFactory();
24 
25  $this->assertInstanceOf("ILIAS\\UI\\Component\\Divider\\Horizontal", $f->horizontal());
26  }
+ Here is the call graph for this function:

◆ test_render_horizontal_empty()

DividerTest::test_render_horizontal_empty ( )

Definition at line 36 of file DividerTest.php.

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

37  {
38  $f = $this->getFactory();
39  $r = $this->getDefaultRenderer();
40 
41  $c = $f->horizontal();
42 
43  $html = trim($r->render($c));
44 
45  $expected_html = "<hr/>";
46 
47  $this->assertHTMLEquals($expected_html, $html);
48  }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:228
$r
Definition: example_031.php:79
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:270
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ test_render_horizontal_with_label()

DividerTest::test_render_horizontal_with_label ( )

Definition at line 50 of file DividerTest.php.

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

51  {
52  $f = $this->getFactory();
53  $r = $this->getDefaultRenderer();
54 
55  $c = $f->horizontal()->withLabel("label");
56 
57  $html = trim($r->render($c));
58  $expected_html = '<hr class="il-divider-with-label" /><h6 class="il-divider">label</h6>';
59 
60  $this->assertHTMLEquals("<div>" . $expected_html . "</div>", "<div>" . $html . "</div>");
61  }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:228
$r
Definition: example_031.php:79
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:270
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ test_render_vertical()

DividerTest::test_render_vertical ( )

Definition at line 63 of file DividerTest.php.

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

64  {
65  $f = $this->getFactory();
66  $r = $this->getDefaultRenderer();
67 
68  $c = $f->vertical();
69 
70  $html = trim($r->render($c));
71  $expected_html = '<span class="glyphicon il-divider-vertical" aria-hidden="true"></span>';
72 
73  $this->assertHTMLEquals("<div>" . $expected_html . "</div>", "<div>" . $html . "</div>");
74  }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:228
$r
Definition: example_031.php:79
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:270
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ test_with_label()

DividerTest::test_with_label ( )

Definition at line 28 of file DividerTest.php.

References $c, $f, and getFactory().

29  {
30  $f = $this->getFactory();
31  $c = $f->horizontal()->withLabel("label");
32 
33  $this->assertEquals($c->getLabel(), "label");
34  }
+ Here is the call graph for this function:

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