ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ButtonMonthTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once(__DIR__ . "/../../../../../../vendor/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 testImplementsFactoryInterface(): void
37 {
38 $f = $this->getFactory();
39
40 $this->assertInstanceOf("ILIAS\\UI\\Component\\Button\\Month", $f->month("02-2017"));
41 }
42
43 public function testGetDefault(): 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 testRender(): 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 <input type="month" class="btn btn-default" value="2017-02" />
63 </div>
64EOT;
65 $this->assertEquals(
66 $this->brutallyTrimHTML($expected_html),
67 $this->brutallyTrimHTML($html)
68 );
69 }
70}
Test month button.
Provides common functionality for UI tests.
Definition: Base.php:337
$c
Definition: deliver.php:25
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21