Skip to content

Commit 6a47409

Browse files
committed
Add testing helper to make NavItem for page
1 parent ac2e0ba commit 6a47409

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/framework/tests/Unit/Views/NavigationLinkViewTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Hyde\Framework\Testing\Unit\Views;
66

7+
use Hyde\Pages\InMemoryPage;
8+
use Hyde\Support\Models\Route;
79
use Hyde\Testing\TestsBladeViews;
810
use Hyde\Testing\Support\TestView;
911
use Hyde\Foundation\Facades\Routes;
@@ -41,6 +43,11 @@ protected function testView(?NavItem $item = null): TestView
4143
]));
4244
}
4345

46+
protected function makeNavItemForPage(): NavItem
47+
{
48+
return NavItem::forRoute(new Route(new InMemoryPage('foo')), 'Foo');
49+
}
50+
4451
public function testComponentLinksToRouteDestination()
4552
{
4653
$this->testView()->assertAttributeIs('href', 'foo.html');

0 commit comments

Comments
 (0)