ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
DrilldownSlateTest Class Reference

Tests for the DrilldownSlate. More...

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

Public Member Functions

 getUIFactory ()
 
 testImplementsFactoryInterface ()
 
 testRendering (Drilldown $slate)
 testImplementsFactoryInterface More...
 
- 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

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.

Referenced by testImplementsFactoryInterface().

33  : NoUIFactory
34  {
35  return new class () extends NoUIFactory {
36  protected function getSigGen()
37  {
38  return new I\SignalGenerator();
39  }
40 
41  public function menu(): C\Menu\Factory
42  {
43  return new I\Menu\Factory($this->getSigGen());
44  }
45 
46  public function symbol(): C\Symbol\Factory
47  {
48  return new I\Symbol\Factory(
49  new I\Symbol\Icon\Factory(),
50  new I\Symbol\Glyph\Factory(),
51  new I\Symbol\Avatar\Factory()
52  );
53  }
54 
55  public function mainControls(): C\MainControls\Factory
56  {
57  $slate_factory = new I\MainControls\Slate\Factory(
58  $this->getSigGen(),
59  new I\Counter\Factory(),
60  $this->symbol()
61  );
62  return new I\MainControls\Factory($this->getSigGen(), $slate_factory);
63  }
64 
65  public function button(): C\Button\Factory
66  {
67  return new I\Button\Factory();
68  }
69  };
70  }
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...
Definition: Bulky.php:21
+ Here is the caller graph for this function:

◆ testImplementsFactoryInterface()

DrilldownSlateTest::testImplementsFactoryInterface ( )

Definition at line 72 of file DrilldownSlateTest.php.

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

72  : Drilldown
73  {
74  $f = $this->getUIFactory();
75  $slate = $f->mainControls()->slate()->drilldown(
76  "ddslate",
77  $f->symbol()->icon()->custom('', ''),
78  $f->menu()->drilldown('ddmenu', [])
79  );
80  $this->assertInstanceOf("ILIAS\\UI\\Component\\MainControls\\Slate\\Drilldown", $slate);
81  return $slate;
82  }
+ Here is the call graph for this function:

◆ testRendering()

DrilldownSlateTest::testRendering ( Drilldown  $slate)

testImplementsFactoryInterface

Definition at line 87 of file DrilldownSlateTest.php.

References ILIAS_UI_TestBase\brutallyTrimHTML(), and ILIAS_UI_TestBase\getDefaultRenderer().

87  : void
88  {
89  $r = $this->getDefaultRenderer();
90  $html = $r->render($slate);
91 
92  $expected = '
93 
94  <div class="il-maincontrols-slate disengaged" id="id_3">
95  <div class="il-maincontrols-slate-content" data-replace-marker="content">
96  <div class="il-drilldown" id="id_2">
97 
98  <header class="show-title show-backnav">
99  <h2>ddmenu</h2>
100  <div class="backnav">
101  <button class="btn btn-bulky" id="id_1" aria-label="back"><span class="glyph" role="img"><span class="glyphicon glyphicon-triangle-left" aria-hidden="true"></span></span><span class="bulky-label"></span></button>
102  </div>
103  </header>
104  <ul>
105  <li><button class="menulevel" aria-expanded="false">ddmenu<span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span></button>
106  <ul></ul>
107  </li>
108  </ul>
109  </div>
110  </div>
111  </div>
112  ';
113  $this->assertEquals(
114  $this->brutallyTrimHTML($expected),
115  $this->brutallyTrimHTML($html)
116  );
117  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:444
+ Here is the call graph for this function:

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