Tests for the Breadcrumbs-component.
More...
Tests for the Breadcrumbs-component.
Definition at line 14 of file BreadcrumbsTest.php.
◆ getFactory()
BreadcrumbsTest::getFactory |
( |
| ) |
|
Definition at line 16 of file BreadcrumbsTest.php.
17 {
18 return new \ILIAS\UI\Implementation\Factory(
19 $this->createMock(
C\Counter\Factory::class),
20 $this->createMock(
C\Glyph\Factory::class),
21 $this->createMock(
C\
Button\Factory::class),
22 $this->createMock(
C\Listing\Factory::class),
23 $this->createMock(
C\Image\Factory::class),
24 $this->createMock(
C\Panel\Factory::class),
25 $this->createMock(
C\Modal\Factory::class),
26 $this->createMock(
C\Dropzone\Factory::class),
27 $this->createMock(
C\Popover\Factory::class),
28 $this->createMock(
C\Divider\Factory::class),
29 $this->createMock(
C\Link\Factory::class),
30 $this->createMock(
C\Dropdown\Factory::class),
31 $this->createMock(
C\Item\Factory::class),
32 $this->createMock(
C\Icon\Factory::class),
33 $this->createMock(
C\ViewControl\Factory::class),
34 $this->createMock(
C\Chart\Factory::class),
35 $this->createMock(
C\Input\Factory::class),
36 $this->createMock(
C\Table\Factory::class),
37 $this->createMock(
C\MessageBox\Factory::class),
38 $this->createMock(
C\Card\Factory::class)
39 );
40 }
Referenced by test_implements_factory_interface(), testAppending(), testCrumbs(), and testRendering().
◆ test_implements_factory_interface()
BreadcrumbsTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 42 of file BreadcrumbsTest.php.
43 {
45 $c =
$f->Breadcrumbs(array());
46
47 $this->assertInstanceOf(
"ILIAS\\UI\\Factory",
$f);
48 $this->assertInstanceOf(
49 "ILIAS\\UI\\Component\\Breadcrumbs\\Breadcrumbs",
50 $f->Breadcrumbs(array())
51 );
52 }
References $c, $f, and getFactory().
◆ testAppending()
BreadcrumbsTest::testAppending |
( |
| ) |
|
Definition at line 66 of file BreadcrumbsTest.php.
67 {
69 $crumb = new I\Component\Link\Standard("label2", '#');
70
71 $c =
$f->Breadcrumbs(array())
72 ->withAppendedItem($crumb);
73 $this->assertEquals(array($crumb),
$c->getItems());
74 }
References $c, $f, and getFactory().
◆ testCrumbs()
BreadcrumbsTest::testCrumbs |
( |
| ) |
|
Definition at line 54 of file BreadcrumbsTest.php.
55 {
57 $crumbs = array(
58 new I\Component\Link\Standard(
"label",
'#'),
59 new I\Component\Link\Standard(
"label2",
'#')
60 );
61
62 $c =
$f->Breadcrumbs($crumbs);
63 $this->assertEquals($crumbs,
$c->getItems());
64 }
References $c, $f, and getFactory().
◆ testRendering()
BreadcrumbsTest::testRendering |
( |
| ) |
|
Definition at line 76 of file BreadcrumbsTest.php.
77 {
80
81 $crumbs = array(
82 new I\Component\Link\Standard(
"label",
'#'),
83 new I\Component\Link\Standard(
"label2",
'#')
84 );
85 $c =
$f->Breadcrumbs($crumbs);
86
88 $expected = '<nav role="navigation" aria-label="breadcrumbs">'
89 . ' <ul class="breadcrumb">'
90 . ' <li class="crumb">'
91 . ' <a href="#">label</a>'
92 . ' </li>'
93 . ' <li class="crumb">'
94 . ' <a href="#">label2</a>'
95 . ' </li>'
96 . ' </ul>'
97 . '</nav>';
98
100 }
assertHTMLEquals($expected_html_as_string, $html_as_string)
getDefaultRenderer(JavaScriptBinding $js_binding=null)
References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), getFactory(), and ILIAS_UI_TestBase\normalizeHTML().
The documentation for this class was generated from the following file: