ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DrilldownSlateTest Class Reference

Tests for the DrilldownSlate. More...

+ Inheritance diagram for DrilldownSlateTest:
+ Collaboration diagram for DrilldownSlateTest:

Public Member Functions

 getUIFactory ()
 
 testImplementsFactoryInterface ()
 
 testRendering (Drilldown $slate)
 

Detailed Description

Tests for the DrilldownSlate.

Definition at line 31 of file DrilldownSlateTest.php.

Member Function Documentation

◆ getUIFactory()

DrilldownSlateTest::getUIFactory ( )

Definition at line 33 of file DrilldownSlateTest.php.

34 {
35 return new class () extends NoUIFactory {
36 protected function getSigGen()
37 {
38 return new I\SignalGenerator();
39 }
40
41 public function menu(): I\Menu\Factory
42 {
43 return new I\Menu\Factory(
44 $this->getSigGen(),
45 );
46 }
47
48 public function symbol(): I\Symbol\Factory
49 {
50 return new I\Symbol\Factory(
51 new I\Symbol\Icon\Factory(),
52 new I\Symbol\Glyph\Factory(),
53 new I\Symbol\Avatar\Factory()
54 );
55 }
56
57 public function mainControls(): I\MainControls\Factory
58 {
59 $slate_factory = new I\MainControls\Slate\Factory(
60 $this->getSigGen(),
61 new I\Counter\Factory(),
62 $this->symbol()
63 );
64 return new I\MainControls\Factory($this->getSigGen(), $slate_factory);
65 }
66
67 public function button(): I\Button\Factory
68 {
69 return new I\Button\Factory();
70 }
71 };
72 }
button(string $caption, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21

References ILIAS\Repository\button(), and ILIAS\Repository\symbol().

Referenced by testImplementsFactoryInterface().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testImplementsFactoryInterface()

DrilldownSlateTest::testImplementsFactoryInterface ( )

Definition at line 74 of file DrilldownSlateTest.php.

74 : Drilldown
75 {
76 $f = $this->getUIFactory();
77 $slate = $f->mainControls()->slate()->drilldown(
78 "ddslate",
79 $f->symbol()->icon()->custom('', ''),
80 $f->menu()->drilldown('ddmenu', [])
81 );
82 $this->assertInstanceOf("ILIAS\\UI\\Component\\MainControls\\Slate\\Drilldown", $slate);
83 return $slate;
84 }

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

+ Here is the call graph for this function:

◆ testRendering()

DrilldownSlateTest::testRendering ( Drilldown  $slate)

Definition at line 87 of file DrilldownSlateTest.php.

87 : void
88 {
89 $r = $this->getDefaultRenderer();
90 $html = $r->render($slate);
91
92 $expected = '
93 <div class="il-maincontrols-slate disengaged" id="id_4">
94 <div class="il-maincontrols-slate-content" data-replace-marker="content">
95 <section class="c-drilldown" id="id_2">
96 <header class="c-drilldown__header--showbacknav">
97 <div></div>
98 <div></div>
99 <div class="c-drilldown__filter">
100 <label for=\'id_3\' class="control-label">filter_nodes_in</label>
101 <input id=\'id_3\' type="text" class="form-control" />
102 </div>
103 <div class="c-drilldown__backnav">
104 <button class="btn btn-bulky" id="id_1" aria-label="back">
105 <span class="glyph" aria-label="collapse/back" role="img">
106 <span class="glyphicon glyphicon-triangle-left" aria-hidden="true"></span>
107 </span>
108 <span class="bulky-label"></span>
109 </button>
110 </div>
111 </header>
112 <div class="c-drilldown__menu">
113 <ul aria-live="polite" aria-label="ddmenu">
114 <li class="c-drilldown__menu--no-items"> drilldown_no_items</li>
115 </ul>
116 </div>
117 </section>
118 </div>
119 </div>
120 ';
121 $this->assertEquals(
122 $this->brutallyTrimHTML($expected),
123 $this->brutallyTrimHTML($html)
124 );
125 }

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