Tests for the Meta Bar.
More...
Tests for the Meta Bar.
Definition at line 16 of file MetaBarTest.php.
◆ brutallyTrimHTML()
MetaBarTest::brutallyTrimHTML |
( |
|
$html | ) |
|
Definition at line 117 of file MetaBarTest.php.
Referenced by testRendering().
119 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
120 $html = preg_replace(
'# {2,}#',
" ", $html);
121 $html = preg_replace(
'/<!--(.|\s)*?-->/',
'', $html);
122 $html = str_replace(
'> <',
'><', $html);
◆ getButton()
MetaBarTest::getButton |
( |
| ) |
|
|
protected |
◆ getSlate()
MetaBarTest::getSlate |
( |
| ) |
|
|
protected |
Definition at line 53 of file MetaBarTest.php.
Referenced by testAddEntry(), and testRendering().
55 $mock = $this->getMockBuilder(Legacy::class)
56 ->disableOriginalConstructor()
57 ->setMethods([
"transformToLegacyComponent"])
60 $mock->method(
'transformToLegacyComponent')->willReturn(
'content');
◆ getUIFactory()
MetaBarTest::getUIFactory |
( |
| ) |
|
Definition at line 87 of file MetaBarTest.php.
References $factory.
90 public function button()
92 return $this->button_factory;
94 public function mainControls() :
C\MainControls\Factory
96 return $this->mc_factory;
98 public function symbol() :
C\Symbol\Factory
100 return new I\Component\Symbol\Factory(
106 public function counter() :
C\Counter\Factory
108 return $this->counter_factory;
111 $factory->button_factory = $this->button_factory;
113 $factory->counter_factory = $this->counter_factory;
◆ setUp()
Definition at line 18 of file MetaBarTest.php.
References metabar().
20 $sig_gen =
new I\Component\SignalGenerator();
21 $this->button_factory =
new I\Component\Button\Factory($sig_gen);
22 $this->icon_factory =
new I\Component\Symbol\Icon\Factory();
23 $this->counter_factory =
new I\Component\Counter\Factory();
25 $slate_factory =
new I\Component\MainControls\Slate\Factory(
27 $this->counter_factory,
35 $this->factory =
new I\Component\MainControls\Factory($sig_gen, $slate_factory);
36 $this->
metabar = $this->factory->metabar();
◆ testAcceptsBulkyLinkAsEntry()
MetaBarTest::testAcceptsBulkyLinkAsEntry |
( |
| ) |
|
◆ testAddEntry()
MetaBarTest::testAddEntry |
( |
| ) |
|
Definition at line 64 of file MetaBarTest.php.
References getButton(), getSlate(), and metabar().
69 ->withAdditionalEntry(
'button', $button)
70 ->withAdditionalEntry(
'slate', $slate);
71 $entries = $mb->getEntries();
72 $this->assertEquals($button, $entries[
'button']);
73 $this->assertEquals($slate, $entries[
'slate']);
◆ testConstruction()
MetaBarTest::testConstruction |
( |
| ) |
|
Definition at line 39 of file MetaBarTest.php.
References metabar().
41 $this->assertInstanceOf(
42 "ILIAS\\UI\\Component\\MainControls\\MetaBar",
◆ testDisallowedEntry()
MetaBarTest::testDisallowedEntry |
( |
| ) |
|
Definition at line 76 of file MetaBarTest.php.
References metabar().
78 $this->expectException(\InvalidArgumentException::class);
79 $mb = $this->
metabar->withAdditionalEntry(
'test',
'wrong_param');
◆ testRendering()
MetaBarTest::testRendering |
( |
| ) |
|
Definition at line 126 of file MetaBarTest.php.
References brutallyTrimHTML(), getButton(), ILIAS_UI_TestBase\getDefaultRenderer(), getSlate(), and metabar().
133 ->withAdditionalEntry(
'button', $button)
134 ->withAdditionalEntry(
'button2', $button);
136 $html = $r->render($mb);
139 <ul class="il-maincontrols-metabar" role="menubar" style="visibility: hidden" aria-label="metabar_aria_label" id="id_5" > 141 <button class="btn btn-bulky" data-action="#" id="id_1" role="menuitem" > 142 <img class="icon custom small" src="" alt=""/><span class="bulky-label">TestEntry</span> 146 <button class="btn btn-bulky" data-action="#" id="id_2" role="menuitem" > 147 <img class="icon custom small" src="" alt=""/><span class="bulky-label">TestEntry</span> 151 <button class="btn btn-bulky" id="id_3" role="menuitem" aria-haspopup="true" > 152 <span class="glyph" aria-label="disclose" role="img"> 153 <span class="glyphicon glyphicon-option-vertical" aria-hidden="true"></span> 154 <span class="il-counter"><span class="badge badge-notify il-counter-status" style="display:none">0</span></span> 155 <span class="il-counter"><span class="badge badge-notify il-counter-novelty" style="display:none">0</span></span> 157 <span class="bulky-label">more</span> 159 <div class="il-metabar-slates"> 160 <div class="il-maincontrols-slate disengaged" id="id_4" role="menu"> 161 <div class="il-maincontrols-slate-content" data-replace-marker="content"></div>
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
◆ testSignalsPresent()
MetaBarTest::testSignalsPresent |
( |
| ) |
|
The documentation for this class was generated from the following file: