Definition at line 28 of file LSLocatorBuilderTest.php.
◆ setUp()
LSLocatorBuilderTest::setUp |
( |
| ) |
|
◆ stripHTML()
LSLocatorBuilderTest::stripHTML |
( |
string |
$html | ) |
|
Definition at line 34 of file LSLocatorBuilderTest.php.
34 : string
35 {
36 $html = $this->normalizeHTML($html);
37 return preg_replace('!\s+!', ' ', $html);
38 }
Referenced by testGUI().
◆ testConstruction()
LSLocatorBuilderTest::testConstruction |
( |
| ) |
|
Definition at line 46 of file LSLocatorBuilderTest.php.
46 : void
47 {
48 $this->assertInstanceOf(LSLocatorBuilder::class, $this->lb);
49 }
◆ testEnd()
LSLocatorBuilderTest::testEnd |
( |
| ) |
|
Definition at line 81 of file LSLocatorBuilderTest.php.
81 : void
82 {
83 $cb = $this->lb->end();
84 $this->assertInstanceOf(ControlBuilder::class, $cb);
85 }
◆ testGUI()
LSLocatorBuilderTest::testGUI |
( |
| ) |
|
Definition at line 87 of file LSLocatorBuilderTest.php.
87 : void
88 {
89 $data_factory = new DataFactory();
90 $uri = $data_factory->uri('https://ilias.de/somepath');
92 $ui_factory = $this->mockUIFactory();
93
94 $items = $this->lb
95 ->item('item 1', 1)
96 ->getItems();
97
99 $out = $gui->withItems($items)->getComponent();
100
101 $this->assertInstanceOf(Breadcrumbs::class,
$out);
102
104 '<nav aria-label="breadcrumbs_aria_label" class="breadcrumb_wrapper"> ' .
105 ' <div class="breadcrumb"> ' .
106 ' <span class="crumb"> ' .
107 ' <a href="https://ilias.de/somepath?lsocmd=cmd&lsov=1">item 1</a>' .
108 ' </span> ' .
109 ' </div>' .
110 '</nav>'
111 );
112
115 $this->assertEquals($expected, $html);
116 }
References $out, $renderer, and stripHTML().
◆ testItemCreation()
LSLocatorBuilderTest::testItemCreation |
( |
| ) |
|
Definition at line 51 of file LSLocatorBuilderTest.php.
51 : void
52 {
53 $this->lb
54 ->item('item 1', 1)
55 ->item('item 2', 2)
56 ->item('item 3', 3);
57
58 $this->assertCount(3, $this->lb->getItems());
59 }
◆ testItemStruct()
LSLocatorBuilderTest::testItemStruct |
( |
| ) |
|
Definition at line 61 of file LSLocatorBuilderTest.php.
61 : void
62 {
63 $this->lb
64 ->item('item 1', 1)
65 ->item('item 2', 2);
66
67 $expected = [
68 [ 'label' => 'item 1',
69 'command' => 'cmd',
70 'parameter' => 1
71 ],
72 [ 'label' => 'item 2',
73 'command' => 'cmd',
74 'parameter' => 2
75 ]
76 ];
77
78 $this->assertEquals($expected, $this->lb->getItems());
79 }
◆ $lb
The documentation for this class was generated from the following file: