From faea07b04747ed3ec1b616dc6b28f86696030800 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 24 Mar 2024 12:56:59 +0100 Subject: [PATCH] Reimplement tests for changed types --- .../framework/tests/Unit/NavigationItemTest.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/framework/tests/Unit/NavigationItemTest.php b/packages/framework/tests/Unit/NavigationItemTest.php index 6daf921bb83..3cb99793a9c 100644 --- a/packages/framework/tests/Unit/NavigationItemTest.php +++ b/packages/framework/tests/Unit/NavigationItemTest.php @@ -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()