ILIAS  release_8 Revision v8.24
ButtonMonthTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21require_once(__DIR__ . "/../../../../libs/composer/vendor/autoload.php");
22require_once(__DIR__ . "/../../Base.php");
23
25
30{
31 public function getFactory(): I\Component\Button\Factory
32 {
33 return new I\Component\Button\Factory();
34 }
35
36 public function test_implements_factory_interface(): void
37 {
38 $f = $this->getFactory();
39
40 $this->assertInstanceOf("ILIAS\\UI\\Component\\Button\\Month", $f->month("02-2017"));
41 }
42
43 public function test_get_default(): void
44 {
45 $f = $this->getFactory();
46 $c = $f->month("02-2017");
47
48 $this->assertEquals("02-2017", $c->getDefault());
49 }
50
51 public function test_render(): 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>
70EOT;
71 $this->assertHTMLEquals("<div>" . $expected_html . "</div>", "<div>" . $html . "</div>");
72 }
73}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Provides common functionality for UI tests.
Definition: Base.php:299
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Definition: Base.php:427
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
$c
Definition: cli.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...