ILIAS  release_8 Revision v8.23
ButtonMonthTest 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 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 ()
 
 getDataFactory ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

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 Test month button

Definition at line 29 of file ButtonMonthTest.php.

Member Function Documentation

◆ getFactory()

ButtonMonthTest::getFactory ( )

Definition at line 31 of file ButtonMonthTest.php.

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

31  : I\Component\Button\Factory
32  {
33  return new I\Component\Button\Factory();
34  }
+ Here is the caller graph for this function:

◆ test_get_default()

ButtonMonthTest::test_get_default ( )

Definition at line 43 of file ButtonMonthTest.php.

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

43  : void
44  {
45  $f = $this->getFactory();
46  $c = $f->month("02-2017");
47 
48  $this->assertEquals("02-2017", $c->getDefault());
49  }
$c
Definition: cli.php:38
+ Here is the call graph for this function:

◆ test_implements_factory_interface()

ButtonMonthTest::test_implements_factory_interface ( )

Definition at line 36 of file ButtonMonthTest.php.

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

36  : void
37  {
38  $f = $this->getFactory();
39 
40  $this->assertInstanceOf("ILIAS\\UI\\Component\\Button\\Month", $f->month("02-2017"));
41  }
+ Here is the call graph for this function:

◆ test_render()

ButtonMonthTest::test_render ( )

Definition at line 51 of file ButtonMonthTest.php.

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

51  : void
52  {
53  $f = $this->getFactory();
54  $r = $this->getDefaultRenderer();
55 
56  $c = $f->month("02-2017");
57 
58  $html = $r->render($c);
59 
60  $expected_html = <<<EOT
61  <div id="id_1" class="btn-group il-btn-month">
62  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
63  <span class="il-current-month">month_02_short 2017</span>
64  <span class="caret"></span>
65  </button>
66  <div class="dropdown-menu" data-default-date="02/1/2017" data-lang="en">
67  <div class="inline-picker"></div>
68  </div>
69 </div>
70 EOT;
71  $this->assertHTMLEquals("<div>" . $expected_html . "</div>", "<div>" . $html . "</div>");
72  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
$c
Definition: cli.php:38
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Definition: Base.php:427
+ Here is the call graph for this function:

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