Skip to content

Commit

Permalink
No longer implement navigation element contract
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 25, 2024
1 parent 3175f91 commit 9b1a1d0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Abstraction for a grouped navigation menu item, like a dropdown or a sidebar group.
*/
class NavigationGroup implements NavigationElement
class NavigationGroup
{
/** @var array<\Hyde\Framework\Features\Navigation\NavigationItem> */
protected array $items = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* 2. You can use NavigationItem::fromRoute() to use data from the route
* 3. You can use NavigationItem::create() for an external or un-routed link
*/
class NavigationItem implements NavigationElement, Stringable
class NavigationItem implements Stringable
{
protected string|Route $destination;
protected string $label;
Expand Down
6 changes: 1 addition & 5 deletions packages/framework/tests/Unit/NavigationGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static function setUpBeforeClass(): void

public function testCanConstruct()
{
$this->assertInstanceOf(NavigationGroup::class, new NavigationGroup('Foo'));
$this->assertSame('Foo', (new NavigationGroup('Foo'))->getLabel());
}

Expand Down Expand Up @@ -57,11 +58,6 @@ public function testCanConstructWithChildrenWithoutRoute()
$this->assertSame($children, $item->getItems());
}

public function testIsInstanceOfNavigationElement()
{
$this->assertInstanceOf(NavigationGroup::class, new NavigationGroup('Foo'));
}

public function testCreate()
{
$this->assertEquals(
Expand Down
6 changes: 0 additions & 6 deletions packages/framework/tests/Unit/NavigationItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Hyde\Testing\UnitTestCase;
use Mockery;
use Hyde\Framework\Features\Navigation\NavigationGroup;
use Hyde\Framework\Features\Navigation\NavigationElement;

/**
* This unit test covers the basics of the NavigationItem class.
Expand Down Expand Up @@ -46,11 +45,6 @@ public function testConstruct()
$this->assertInstanceOf(NavigationItem::class, new NavigationItem(new Route(new MarkdownPage()), 'Test', 500));
}

public function testIsInstanceOfNavigationElement()
{
$this->assertInstanceOf(NavigationElement::class, new NavigationItem(new Route(new MarkdownPage()), 'Test', 500));
}

public function testPassingRouteInstanceToConstructorUsesRouteInstance()
{
$route = new Route(new MarkdownPage());
Expand Down

0 comments on commit 9b1a1d0

Please sign in to comment.