| @@ 178-193 (lines=16) @@ | ||
| 175 | } |
|
| 176 | ||
| 177 | /** @test */ |
|
| 178 | public function it_tests_insert_before_dropdown() |
|
| 179 | { |
|
| 180 | $menu = $this->menu->getMenu('test'); |
|
| 181 | ||
| 182 | $menu->dropdown('slug', 'name', function (DropDown $dropdown) { |
|
| 183 | $dropdown->link('slug2', function () { |
|
| 184 | // |
|
| 185 | }); |
|
| 186 | }); |
|
| 187 | ||
| 188 | $menu->link('slug3', function ($link) { |
|
| 189 | $link->insertBefore('slug2'); |
|
| 190 | }); |
|
| 191 | ||
| 192 | $this->assertEquals('slug3', $menu->links->first()->links->first()->slug); |
|
| 193 | } |
|
| 194 | ||
| 195 | /** @test */ |
|
| 196 | public function it_tests_insert_after_link() |
|
| @@ 196-217 (lines=22) @@ | ||
| 193 | } |
|
| 194 | ||
| 195 | /** @test */ |
|
| 196 | public function it_tests_insert_after_link() |
|
| 197 | { |
|
| 198 | $menu = $this->menu->getMenu('test'); |
|
| 199 | ||
| 200 | $menu->link('slug', function () { |
|
| 201 | // |
|
| 202 | }); |
|
| 203 | ||
| 204 | $menu->link('slug2', function () { |
|
| 205 | // |
|
| 206 | }); |
|
| 207 | ||
| 208 | $menu->link('slug3', function () { |
|
| 209 | // |
|
| 210 | }); |
|
| 211 | ||
| 212 | $menu->link('slug4', function (Link $link) { |
|
| 213 | $link->insertAfter('slug2'); |
|
| 214 | }); |
|
| 215 | ||
| 216 | $this->assertEquals('slug4', $menu->links->get(2)->slug); |
|
| 217 | } |
|
| 218 | ||
| 219 | /** @test */ |
|
| 220 | public function it_tests_insert_after_dropdown() |
|