Skip to content

Commit 218590d

Browse files
committed
Replace dependences on deprecated class with inlined strings
We need the kernel and config so we can check if the routes exist
1 parent 1eea4de commit 218590d

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

packages/framework/tests/Feature/NavigationMenuTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Hyde\Hyde;
88
use Hyde\Support\Models\Route;
99
use Hyde\Foundation\Facades\Routes;
10-
use Hyde\Support\Models\ExternalRoute;
1110
use Hyde\Framework\Features\Navigation\NavigationGroup;
1211
use Hyde\Framework\Features\Navigation\MainNavigationMenu;
1312
use Hyde\Framework\Features\Navigation\NavigationItem;
@@ -268,7 +267,7 @@ public function testCanAddItemsToMainNavigationMenuResolvedFromContainer()
268267
Hyde::boot();
269268

270269
$navigation = app('navigation.main');
271-
$navigation->add(new NavigationItem(new ExternalRoute('/foo'), 'Foo'));
270+
$navigation->add(new NavigationItem('/foo', 'Foo'));
272271

273272
$this->assertCount(2, $navigation->getItems());
274273
$this->assertSame('Foo', $navigation->getItems()->last()->getLabel());

packages/framework/tests/Unit/DocumentationSidebarUnitTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Hyde\Testing\UnitTestCase;
88
use Illuminate\Support\Collection;
9-
use Hyde\Support\Models\ExternalRoute;
109
use Hyde\Framework\Features\Navigation\NavigationItem;
1110
use Hyde\Framework\Features\Navigation\NavigationGroup;
1211
use Hyde\Framework\Features\Navigation\DocumentationSidebar;
@@ -21,6 +20,9 @@
2120
*/
2221
class DocumentationSidebarUnitTest extends UnitTestCase
2322
{
23+
protected static bool $needsKernel = true;
24+
protected static bool $needsConfig = true;
25+
2426
// Base menu tests
2527

2628
public function testCanConstruct()
@@ -228,6 +230,6 @@ protected function getItems(): array
228230

229231
protected function item(string $destination, string $label, int $priority = 500): NavigationItem
230232
{
231-
return new NavigationItem(new ExternalRoute($destination), $label, $priority);
233+
return new NavigationItem($destination, $label, $priority);
232234
}
233235
}

packages/framework/tests/Unit/NavigationMenuUnitTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Hyde\Testing\UnitTestCase;
88
use Illuminate\Support\Collection;
9-
use Hyde\Support\Models\ExternalRoute;
109
use Hyde\Framework\Features\Navigation\NavigationItem;
1110
use Hyde\Framework\Features\Navigation\MainNavigationMenu;
1211

@@ -19,6 +18,9 @@
1918
*/
2019
class NavigationMenuUnitTest extends UnitTestCase
2120
{
21+
protected static bool $needsKernel = true;
22+
protected static bool $needsConfig = true;
23+
2224
// Base menu tests
2325

2426
public function testCanConstruct()
@@ -159,6 +161,6 @@ protected function getItems(): array
159161

160162
protected function item(string $destination, string $label, int $priority = 500): NavigationItem
161163
{
162-
return new NavigationItem(new ExternalRoute($destination), $label, $priority);
164+
return new NavigationItem($destination, $label, $priority);
163165
}
164166
}

0 commit comments

Comments
 (0)