Skip to content

Commit f536688

Browse files
committed
Add toRoute() test
1 parent 1e13360 commit f536688

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/framework/tests/Unit/NavItemTest.php

+11
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ public function testToLink()
6767
$this->assertFalse($item->hidden);
6868
}
6969

70+
public function testToRoute()
71+
{
72+
$route = Route::get('index');
73+
$item = NavItem::toRoute($route, 'foo', 10);
74+
75+
$this->assertSame($route, $item->route);
76+
$this->assertSame('foo', $item->title);
77+
$this->assertSame(10, $item->priority);
78+
$this->assertFalse($item->hidden);
79+
}
80+
7081
public function testIsCurrentRoute()
7182
{
7283
$route = Route::get('index');

0 commit comments

Comments
 (0)