| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | trait InteractsWithPages |
||
| 13 | { |
||
| 14 | protected function mockRoute(?Route $route = null): static |
||
| 15 | { |
||
| 16 | Render::share('route', $route ?? (new Route(new InMemoryPage()))); |
||
| 17 | |||
| 18 | return $this; |
||
| 19 | } |
||
| 20 | |||
| 21 | protected function mockPage(?HydePage $page = null, ?string $currentPage = null): static |
||
| 22 | { |
||
| 23 | Render::share('page', $page ?? new InMemoryPage()); |
||
| 24 | Render::share('routeKey', $currentPage ?? 'foo'); |
||
| 25 | |||
| 26 | return $this; |
||
| 27 | } |
||
| 28 | |||
| 29 | protected function mockCurrentPage(string $currentPage): static |
||
| 30 | { |
||
| 31 | Render::share('routeKey', $currentPage); |
||
| 32 | Render::share('route', new Route(new InMemoryPage($currentPage))); |
||
| 33 | |||
| 34 | return $this; |
||
| 35 | } |
||
| 37 |