| Conditions | 2 |
| Paths | 2 |
| Total Lines | 31 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 375 | public function testInsertChildButton(string $insertion_point, array $expected): void |
||
| 376 | { |
||
| 377 | foreach (['before', 'after', 'child_of'] as $where) |
||
| 378 | { |
||
| 379 | $haystack = [ |
||
| 380 | 'test' => [ |
||
| 381 | 'href' => 'link', |
||
| 382 | 'show' => true, |
||
| 383 | 'sub_buttons' => [ |
||
| 384 | 'sub' => [ |
||
| 385 | 'href' => 'link', |
||
| 386 | 'show' => true, |
||
| 387 | ], |
||
| 388 | 'sub1' => [ |
||
| 389 | 'href' => 'link', |
||
| 390 | 'show' => true, |
||
| 391 | ], |
||
| 392 | ], |
||
| 393 | ], |
||
| 394 | ]; |
||
| 395 | recursive_button( |
||
| 396 | [ |
||
| 397 | 'href' => 'link', |
||
| 398 | 'show' => true, |
||
| 399 | ], |
||
| 400 | $haystack, |
||
| 401 | $insertion_point, |
||
| 402 | $where, |
||
| 403 | 'inserted_' . $insertion_point |
||
| 404 | ); |
||
| 405 | $this->assertSame($expected[$where], $haystack); |
||
| 406 | } |
||
| 421 |