Skip to content

Commit

Permalink
Add toRoute() test
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jul 10, 2022
1 parent 1e13360 commit f536688
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/framework/tests/Unit/NavItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ public function testToLink()
$this->assertFalse($item->hidden);
}

public function testToRoute()
{
$route = Route::get('index');
$item = NavItem::toRoute($route, 'foo', 10);

$this->assertSame($route, $item->route);
$this->assertSame('foo', $item->title);
$this->assertSame(10, $item->priority);
$this->assertFalse($item->hidden);
}

public function testIsCurrentRoute()
{
$route = Route::get('index');
Expand Down

0 comments on commit f536688

Please sign in to comment.