Skip to content

Commit

Permalink
Update constructor to use the same logic as the static create method
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 26, 2024
1 parent 12925d3 commit 3979fa8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/framework/tests/Unit/NavigationItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ public function testPassingRouteInstanceToConstructorUsesRouteInstance()
$this->assertEquals($route, (new NavigationItem($route, 'Home'))->getPage()->getRoute());
}

public function testPassingRouteKeyToConstructorUsesDestinationAsLink()
public function testPassingRouteKeyToConstructorUsesDestinationAsRoute()
{
$item = new NavigationItem('index', 'Home');
$this->assertNull($item->getPage());
$this->assertSame('index', $item->getLink());
$this->assertSame(Routes::get('index')->getPage(), $item->getPage());
$this->assertSame('index', $item->getPage()->getRouteKey());
$this->assertSame('index.html', $item->getLink());
}

public function testPassingUrlToConstructorSetsRouteToNull()
Expand Down

0 comments on commit 3979fa8

Please sign in to comment.