ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML ($html)
 A more radical version of normalizeHTML. More...
 

Detailed Description

Test month button.

Definition at line 14 of file ButtonMonthTest.php.

Member Function Documentation

◆ getFactory()

ButtonMonthTest::getFactory ( )
Returns

Definition at line 20 of file ButtonMonthTest.php.

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

21  {
22  return $this->button_factory = new I\Component\Button\Factory();
23  }
+ Here is the caller graph for this function:

◆ test_get_default()

ButtonMonthTest::test_get_default ( )

Definition at line 32 of file ButtonMonthTest.php.

References $c, Vendor\Package\$f, and getFactory().

33  {
34  $f = $this->getFactory();
35  $c = $f->month("02-2017");
36 
37  $this->assertEquals($c->getDefault(), "02-2017");
38  }
$c
Definition: cli.php:37
+ Here is the call graph for this function:

◆ test_implements_factory_interface()

ButtonMonthTest::test_implements_factory_interface ( )

Definition at line 25 of file ButtonMonthTest.php.

References Vendor\Package\$f, and getFactory().

26  {
27  $f = $this->getFactory();
28 
29  $this->assertInstanceOf("ILIAS\\UI\\Component\\Button\\Month", $f->month("02-2017"));
30  }
+ Here is the call graph for this function:

◆ test_render()

ButtonMonthTest::test_render ( )

Definition at line 40 of file ButtonMonthTest.php.

References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().

41  {
42  $f = $this->getFactory();
43  $r = $this->getDefaultRenderer();
44 
45  $c = $f->month("02-2017");
46 
47  $html = $r->render($c);
48 
49  $expected_html = <<<EOT
50  <div class="btn-group il-btn-month">
51  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
52  <span class="il-current-month">month_02_short 2017</span>
53  <span class="caret"></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>
60 EOT;
61  $this->assertHTMLEquals("<div>" . $expected_html . "</div>", "<div>" . $html . "</div>");
62  }
$c
Definition: cli.php:37
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:372
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
Definition: Base.php:311
+ Here is the call graph for this function:

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