Tests for the Standard Page.
More...
Tests for the Standard Page.
Definition at line 43 of file StandardPageTest.php.
◆ getDataFactory()
StandardPageTest::getDataFactory |
( |
| ) |
|
Definition at line 407 of file StandardPageTest.php.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ getMockedTag()
StandardPageTest::getMockedTag |
( |
string |
$html | ) |
|
◆ getUIFactory()
StandardPageTest::getUIFactory |
( |
| ) |
|
Definition at line 392 of file StandardPageTest.php.
References ILIAS\Repository\button().
397 return new Button\Factory();
button(string $caption, string $cmd)
Builds a Color from either hex- or rgb values.
This implements commonalities between different types of Dropdowns.
◆ setUp()
StandardPageTest::setUp |
( |
| ) |
|
Definition at line 60 of file StandardPageTest.php.
References factory(), ILIAS\UI\examples\MainControls\MainBar\mainbar(), and null.
63 $this->metabar = $this->createMock(MetaBar::class);
64 $this->metabar->method(
"getCanonicalName")->willReturn(
"MetaBar Stub");
65 $this->
mainbar = $this->createMock(MainBar::class);
66 $this->
mainbar->method(
"getCanonicalName")->willReturn(
"MainBar Stub");
67 $this->crumbs = $this->createMock(Breadcrumbs::class);
68 $this->crumbs->method(
"getCanonicalName")->willReturn(
"Breadcrumbs Stub");
69 $this->logo = $this->createMock(Image::class);
70 $this->logo->method(
"getCanonicalName")->willReturn(
"Logo Stub");
71 $this->responsive_logo = $this->createMock(Image::class);
72 $this->responsive_logo->method(
"getCanonicalName")->willReturn(
"Responsive Logo Stub");
73 $this->overlay = $this->createMock(Container::class);
74 $this->overlay->method(
"getCanonicalName")->willReturn(
"Overlay Stub");
75 $this->contents = array(
new Content(
'some content', $sig_gen));
76 $this->title =
'pagetitle';
78 $this->
factory =
new Page\Factory();
79 $this->stdpage = $this->
factory->standard(
85 $this->responsive_logo,
mainbar()
expected output: > ILIAS shows a link "Full Screen Page Layout".
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testConstruction()
StandardPageTest::testConstruction |
( |
| ) |
|
Definition at line 93 of file StandardPageTest.php.
95 $this->assertInstanceOf(
96 "ILIAS\\UI\\Component\\Layout\\Page\\Standard",
◆ testGetBreadcrumbs()
StandardPageTest::testGetBreadcrumbs |
( |
| ) |
|
◆ testGetContent()
StandardPageTest::testGetContent |
( |
| ) |
|
◆ testGetLogo()
StandardPageTest::testGetLogo |
( |
| ) |
|
◆ testGetMainbar()
StandardPageTest::testGetMainbar |
( |
| ) |
|
◆ testGetMetabar()
StandardPageTest::testGetMetabar |
( |
| ) |
|
◆ testGetOverlay()
StandardPageTest::testGetOverlay |
( |
| ) |
|
◆ testGetResponsiveLogo()
StandardPageTest::testGetResponsiveLogo |
( |
| ) |
|
Definition at line 146 of file StandardPageTest.php.
149 $this->responsive_logo,
150 $this->stdpage->getResponsiveLogo()
◆ testGetTitle()
StandardPageTest::testGetTitle |
( |
| ) |
|
◆ testHasLogo()
StandardPageTest::testHasLogo |
( |
| ) |
|
◆ testHasResponsiveLogo()
StandardPageTest::testHasResponsiveLogo |
( |
| ) |
|
◆ testRenderingWithCrumbs()
StandardPageTest::testRenderingWithCrumbs |
( |
| ) |
|
Definition at line 412 of file StandardPageTest.php.
References $r, factory(), ILIAS\UI\examples\MainControls\MainBar\mainbar(), and null.
419 $r = $this->getDefaultRenderer(
null, [$this->metabar, $this->
mainbar, $this->logo, $this->overlay]);
427 $this->responsive_logo,
434 $html = $this->brutallyTrimHTML(
$r->render(
$stdpage));
436 $exptected = $this->brutallyTrimHTML(
438 <html lang="en" dir="ltr"> 441 <meta charset="utf-8" /> 442 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 443 <meta name="viewport" content="width=device-width, initial-scale=1" /> 445 <link rel="icon" href="logo/favicon.ico" type="image/x-icon"> 446 <script type="application/javascript">var il = il ||{}; window.il = il;</script> 451 <div class="il-page-overlay">Overlay Stub</div> 452 <div class="il-layout-page"> 454 <div class="header-inner"> 455 <div class="il-logo"><span class="hidden-xs">Logo Stub</span><span class="visible-xs-block">Responsive Logo Stub</span> 456 <div class="il-pagetitle">pagetitle</div> 458 <nav class="il-header-locator"> 459 <div class="dropdown" id="id_3"><button class="btn btn-default dropdown-toggle" type="button" aria-haspopup="true" aria-expanded="false" aria-controls="id_3_menu">label3<span class="caret"></span></button> 460 <ul id="id_3_menu" class="dropdown-menu"> 461 <li><button class="btn btn-link" data-action="#" id="id_1">label2</button></li> 462 <li><button class="btn btn-link" data-action="#" id="id_2">label1</button></li> 468 <div class="il-system-infos"></div> 469 <div class="nav il-maincontrols">MainBar Stub</div> 470 <main class="il-layout-page-content"> 471 <div class="breadcrumbs"> 472 <nav aria-label="breadcrumbs_aria_label" class="breadcrumb_wrapper"> 473 <div class="breadcrumb"><span class="crumb"><a href="#">label1</a></span><span class="crumb"><a href="#">label2</a></span><span class="crumb"><a href="#">label3</a></span></div> 478 <script>il.Util.addOnLoad(function() {});</script> 483 $this->assertEquals($exptected, $html);
mainbar()
expected output: > ILIAS shows a link "Full Screen Page Layout".
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testRenderingWithMetaData()
StandardPageTest::testRenderingWithMetaData |
( |
| ) |
|
Definition at line 339 of file StandardPageTest.php.
References $r, getMockedTag(), ILIAS\UI\examples\MainControls\MainBar\mainbar(), and null.
341 $meta_datum_1_html =
'test_html_1';
342 $meta_datum_2_html =
'test_html_2';
343 $meta_datum_1 = $this->
getMockedTag($meta_datum_1_html);
344 $meta_datum_2 = $this->
getMockedTag($meta_datum_2_html);
346 $this->stdpage = $this->stdpage->withAdditionalMetaDatum($meta_datum_1);
347 $this->stdpage = $this->stdpage->withAdditionalMetaDatum($meta_datum_2);
349 $r = $this->getDefaultRenderer(
351 [$this->metabar, $this->
mainbar, $this->crumbs, $this->logo, $this->overlay]
353 $html = $this->brutallyTrimHTML(
$r->render($this->stdpage));
354 $expected = $this->brutallyTrimHTML(
357 <html lang="en" dir="ltr"> 360 <meta charset="utf-8" /> 361 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 362 <meta name="viewport" content="width=device-width, initial-scale=1" /> 363 ' . $meta_datum_1_html . $meta_datum_2_html .
' 365 <link rel="icon" href="logo/favicon.ico" type="image/x-icon"> 366 <script type="application/javascript">var il = il ||{}; window.il = il;</script> 371 <div class="il-page-overlay">Overlay Stub</div> 372 <div class="il-layout-page"> 374 <div class="header-inner"> 375 <div class="il-logo"><span class="hidden-xs">Logo Stub</span><span class="visible-xs-block">Responsive Logo Stub</span> 376 <div class="il-pagetitle">pagetitle</div> 380 <div class="il-system-infos"></div> 381 <div class="nav il-maincontrols">MainBar Stub</div> 382 <main class="il-layout-page-content">some content</main> 384 <script>il.Util.addOnLoad(function() {});</script> 389 $this->assertEquals($expected, $html);
mainbar()
expected output: > ILIAS shows a link "Full Screen Page Layout".
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getMockedTag(string $html)
◆ testRenderingWithRtlLanguage()
StandardPageTest::testRenderingWithRtlLanguage |
( |
| ) |
|
Definition at line 293 of file StandardPageTest.php.
References $r, ILIAS\UI\examples\MainControls\MainBar\mainbar(), and null.
295 $this->stdpage = $this->stdpage->withTextDirection($this->stdpage::RTL);
297 $r = $this->getDefaultRenderer(
299 [$this->metabar, $this->
mainbar, $this->crumbs, $this->logo, $this->overlay]
301 $html = $this->brutallyTrimHTML(
$r->render($this->stdpage));
303 $exptected = $this->brutallyTrimHTML(
305 <html lang="en" dir="rtl"> 308 <meta charset="utf-8" /> 309 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 310 <meta name="viewport" content="width=device-width, initial-scale=1" /> 312 <link rel="icon" href="logo/favicon.ico" type="image/x-icon"> 313 <script type="application/javascript">var il = il ||{}; window.il = il;</script> 318 <div class="il-page-overlay">Overlay Stub</div> 319 <div class="il-layout-page"> 321 <div class="header-inner"> 322 <div class="il-logo"><span class="hidden-xs">Logo Stub</span><span class="visible-xs-block">Responsive Logo Stub</span> 323 <div class="il-pagetitle">pagetitle</div> 327 <div class="il-system-infos"></div> 328 <div class="nav il-maincontrols">MainBar Stub</div> 329 <main class="il-layout-page-content">some content</main> 331 <script>il.Util.addOnLoad(function() {});</script> 336 $this->assertEquals($exptected, $html);
mainbar()
expected output: > ILIAS shows a link "Full Screen Page Layout".
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testRenderingWithTitle()
StandardPageTest::testRenderingWithTitle |
( |
| ) |
|
Definition at line 244 of file StandardPageTest.php.
References $r, ILIAS\UI\examples\MainControls\MainBar\mainbar(), and null.
246 $this->stdpage = $this->stdpage
248 ->withViewTitle(
"View Title")
249 ->withShortTitle(
"Short Title");
251 $r = $this->getDefaultRenderer(
253 [$this->metabar, $this->
mainbar, $this->crumbs, $this->logo, $this->overlay]
255 $html = $this->brutallyTrimHTML(
$r->render($this->stdpage));
257 $exptected = $this->brutallyTrimHTML(
259 <html lang="en" dir="ltr"> 262 <meta charset="utf-8" /> 263 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 264 <meta name="viewport" content="width=device-width, initial-scale=1" /> 265 <title>View Title: Short Title</title> 266 <link rel="icon" href="logo/favicon.ico" type="image/x-icon"> 267 <script type="application/javascript">var il = il ||{}; window.il = il;</script> 272 <div class="il-page-overlay">Overlay Stub</div> 273 <div class="il-layout-page"> 275 <div class="header-inner"> 276 <div class="il-logo"><span class="hidden-xs">Logo Stub</span><span class="visible-xs-block">Responsive Logo Stub</span> 277 <div class="il-pagetitle">Title</div> 281 <div class="il-system-infos"></div> 282 <div class="nav il-maincontrols">MainBar Stub</div> 283 <main class="il-layout-page-content">some content</main> 285 <script>il.Util.addOnLoad(function() {});</script> 290 $this->assertEquals($exptected, $html);
mainbar()
expected output: > ILIAS shows a link "Full Screen Page Layout".
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testWithFaviconPath()
StandardPageTest::testWithFaviconPath |
( |
| ) |
|
Definition at line 159 of file StandardPageTest.php.
161 $this->assertEquals(
"logo/favicon.ico", $this->stdpage->getFaviconPath());
164 $this->stdpage->withFaviconPath(
"test")->getFaviconPath()
◆ testWithMetaDatum()
StandardPageTest::testWithMetaDatum |
( |
| ) |
|
Definition at line 234 of file StandardPageTest.php.
References getMockedTag().
236 $meta_datum_html =
'test_html';
240 $this->stdpage->withAdditionalMetaDatum($meta_datum)->getMetaData()
getMockedTag(string $html)
◆ testWithShortTitle()
StandardPageTest::testWithShortTitle |
( |
| ) |
|
◆ testWithTextDirection()
StandardPageTest::testWithTextDirection |
( |
| ) |
|
Definition at line 223 of file StandardPageTest.php.
225 $this->assertEquals(
"ltr", $this->stdpage->getTextDirection());
229 ->withTextDirection($this->stdpage::RTL)
◆ testWithTitle()
StandardPageTest::testWithTitle |
( |
| ) |
|
◆ testWithViewTitle()
StandardPageTest::testWithViewTitle |
( |
| ) |
|
◆ testWithWrongContents()
StandardPageTest::testWithWrongContents |
( |
| ) |
|
◆ $contents
array StandardPageTest::$contents |
|
protected |
◆ $crumbs
◆ $factory
◆ $logo
Image StandardPageTest::$logo |
|
protected |
◆ $mainbar
◆ $metabar
◆ $overlay
◆ $responsive_logo
Image StandardPageTest::$responsive_logo |
|
protected |
◆ $stdpage
◆ $title
string StandardPageTest::$title |
|
protected |
The documentation for this class was generated from the following file: