Skip to content

Commit

Permalink
Merge branch 'improved-navigation-internals' into clean-up-navigation…
Browse files Browse the repository at this point in the history
…-view-markup
  • Loading branch information
caendesilva committed Mar 14, 2024
2 parents 282d1fe + f91e464 commit e15daca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/testing/src/InteractsWithPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,26 @@

trait InteractsWithPages
{
protected function mockRoute(?Route $route = null): void
protected function mockRoute(?Route $route = null): static
{
Render::share('route', $route ?? (new Route(new InMemoryPage())));

return $this;
}

protected function mockPage(?HydePage $page = null, ?string $currentPage = null): void
protected function mockPage(?HydePage $page = null, ?string $currentPage = null): static
{
Render::share('page', $page ?? new InMemoryPage());
Render::share('routeKey', $currentPage ?? 'foo');

return $this;
}

protected function mockCurrentPage(string $currentPage): void
protected function mockCurrentPage(string $currentPage): static
{
Render::share('routeKey', $currentPage);
Render::share('route', new Route(new InMemoryPage($currentPage)));

return $this;
}
}

0 comments on commit e15daca

Please sign in to comment.