Skip to content

Commit

Permalink
Reimplement tests for changed types
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 24, 2024
1 parent c520390 commit faea07b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/framework/tests/Unit/NavigationItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,18 @@ public function testPassingRouteKeyToConstructorUsesRouteInstance()
$this->assertSame($route, (new NavigationItem('index', 'Home'))->getRoute());
}

public function testPassingUrlToConstructorUsesExternalRoute()
public function testPassingUrlToConstructorSetsRouteToNull()
{
$this->markTestSkipped('Todo: Reimplement this test for https://github.com/hydephp/develop/pull/1636');
$item = new NavigationItem('https://example.com', 'Home');
$this->assertInstanceOf(ExternalRoute::class, $item->getRoute());
$this->assertEquals(new ExternalRoute('https://example.com'), $item->getRoute());
$this->assertSame('https://example.com', (string) $item->getRoute());
$this->assertNull($item->getRoute());
$this->assertSame('https://example.com', $item->getUrl());
}

public function testPassingUnknownRouteKeyToConstructorUsesExternalRoute()
public function testPassingUnknownRouteKeyToConstructorSetsRouteToNull()
{
$this->markTestSkipped('Todo: Reimplement this test for https://github.com/hydephp/develop/pull/1636');
$item = new NavigationItem('foo', 'Home');
$this->assertInstanceOf(ExternalRoute::class, $item->getRoute());
$this->assertEquals(new ExternalRoute('foo'), $item->getRoute());
$this->assertSame('foo', (string) $item->getRoute());
$this->assertNull($item->getRoute());
$this->assertSame('foo', $item->getUrl());
}

public function testGetDestination()
Expand Down

0 comments on commit faea07b

Please sign in to comment.