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

Test month button. More...

+ Inheritance diagram for ButtonMonthTest:
+ Collaboration diagram for ButtonMonthTest:

Public Member Functions

 getFactory ()
 
 test_implements_factory_interface ()
 
 test_get_default ()
 
 test_render ()
 
- 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 month button.

Definition at line 13 of file ButtonMonthTest.php.

Member Function Documentation

◆ getFactory()

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

Definition at line 19 of file ButtonMonthTest.php.

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

Referenced by test_get_default(), test_implements_factory_interface(), and test_render().

+ Here is the caller graph for this function:

◆ test_get_default()

ButtonMonthTest::test_get_default ( )

Definition at line 31 of file ButtonMonthTest.php.

32 {
33 $f = $this->getFactory();
34 $c = $f->button()->month("02-2017");
35
36 $this->assertEquals($c->getDefault(), "02-2017");
37 }

References getFactory().

+ Here is the call graph for this function:

◆ test_implements_factory_interface()

ButtonMonthTest::test_implements_factory_interface ( )

Definition at line 24 of file ButtonMonthTest.php.

25 {
26 $f = $this->getFactory();
27
28 $this->assertInstanceOf("ILIAS\\UI\\Component\\Button\\Month", $f->button()->month("02-2017"));
29 }

References getFactory().

+ Here is the call graph for this function:

◆ test_render()

ButtonMonthTest::test_render ( )

Definition at line 39 of file ButtonMonthTest.php.

40 {
41 $f = $this->getFactory();
42 $r = $this->getDefaultRenderer();
43
44 $c = $f->button()->month("02-2017");
45
46 $html = $r->render($c);
47
48 $expected_html = <<<EOT
49 <div class="btn-group il-btn-month">
50 <button type="button" class="btn btn-default dropdown-toggle" href="" data-toggle="dropdown" aria-expanded="false">
51 <span class="il-current-month">month_02_short 2017</span>
52 <span class="caret"></span>
53 <span class="sr-only"></span>
54 </button>
55 <div class="dropdown-menu" data-default-date="02/1/2017" data-lang="en">
56 <div class="inline-picker"></div>
57 </div>
58</div>
59<script>il.Util.addOnLoad(function() {il.UI.button.initMonth('');});</script>
60EOT;
61 $this->assertHTMLEquals("<div>" . $expected_html . "</div>", "<div>" . $html . "</div>");
62 }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
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
$this data['403_header']

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

+ Here is the call graph for this function:

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