Skip to content

Commit

Permalink
Restructure test
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 24, 2024
1 parent 2f963c6 commit 67066be
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/framework/tests/Unit/NavigationItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ protected function setUp(): void

public function testConstruct()
{
$route = new Route(new MarkdownPage());
$item = new NavigationItem($route, 'Test', 500);

$this->assertSame($route, $item->getRoute());
$this->assertInstanceOf(NavigationItem::class, new NavigationItem('foo', 'Test'));
$this->assertInstanceOf(NavigationItem::class, new NavigationItem(new Route(new MarkdownPage()), 'Test'));
$this->assertInstanceOf(NavigationItem::class, new NavigationItem(new Route(new MarkdownPage()), 'Test', 500));
$this->assertInstanceOf(NavigationItem::class, new NavigationItem(new Route(new MarkdownPage()), 'Test', 500, 'foo'));
}

public function testIsInstanceOfNavigationElement()
Expand Down Expand Up @@ -79,6 +79,14 @@ public function testPassingUnknownRouteKeyToConstructorSetsRouteToNull()
$this->assertSame('foo', $item->getUrl());
}

public function testCanGetPage()
{
$page = new MarkdownPage();
$item = new NavigationItem(new Route($page), 'Test', 500);

$this->assertSame($page, $item->getPage());
}

public function testGetDestination()
{
$route = new Route(new InMemoryPage('foo'));
Expand Down

0 comments on commit 67066be

Please sign in to comment.