Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Feb 29, 2024
1 parent efbe0b1 commit 0e657ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Hyde\Framework\Testing\Unit;

use Hyde\Testing\UnitTestCase;
use Hyde\Support\Models\Route;
use Hyde\Pages\DocumentationPage;
use Illuminate\Support\Collection;
use Hyde\Support\Models\ExternalRoute;
Expand Down
20 changes: 10 additions & 10 deletions packages/framework/tests/Unit/NavItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function testToString()
{
Render::shouldReceive('getRouteKey')->once()->andReturn('index');

$this->assertSame('index.html', (string)NavItem::forRoute(Routes::get('index')));
$this->assertSame('index.html', (string) NavItem::forRoute(Routes::get('index')));
}

public function testForLink()
Expand Down Expand Up @@ -241,24 +241,24 @@ public function testRouteBasedNavItemDestinationsAreResolvedRelatively()
'getRouteKey' => 'foo',
]));

$this->assertSame('foo.html', (string)NavItem::forRoute((new Route(new InMemoryPage('foo')))));
$this->assertSame('foo/bar.html', (string)NavItem::forRoute((new Route(new InMemoryPage('foo/bar')))));
$this->assertSame('foo.html', (string) NavItem::forRoute(new Route(new InMemoryPage('foo'))));
$this->assertSame('foo/bar.html', (string) NavItem::forRoute(new Route(new InMemoryPage('foo/bar'))));

Render::swap(Mockery::mock(RenderData::class, [
'getRoute' => new Route(new InMemoryPage('foo/bar')),
'getRouteKey' => 'foo/bar',
]));

$this->assertSame('../foo.html', (string)NavItem::forRoute((new Route(new InMemoryPage('foo')))));
$this->assertSame('../foo/bar.html', (string)NavItem::forRoute((new Route(new InMemoryPage('foo/bar')))));
$this->assertSame('../foo.html', (string) NavItem::forRoute(new Route(new InMemoryPage('foo'))));
$this->assertSame('../foo/bar.html', (string) NavItem::forRoute(new Route(new InMemoryPage('foo/bar'))));

Render::swap(Mockery::mock(RenderData::class, [
'getRoute' => new Route(new InMemoryPage('foo/bar/baz')),
'getRouteKey' => 'foo/bar/baz',
]));

$this->assertSame('../../foo.html', (string)NavItem::forRoute((new Route(new InMemoryPage('foo')))));
$this->assertSame('../../foo/bar.html', (string)NavItem::forRoute((new Route(new InMemoryPage('foo/bar')))));
$this->assertSame('../../foo.html', (string) NavItem::forRoute(new Route(new InMemoryPage('foo'))));
$this->assertSame('../../foo/bar.html', (string) NavItem::forRoute(new Route(new InMemoryPage('foo/bar'))));
}

public function testDropdownFacade()
Expand Down Expand Up @@ -309,8 +309,8 @@ public function testIsCurrent()
'getRoute' => new Route(new InMemoryPage('foo')),
'getRouteKey' => 'foo',
]));
$this->assertTrue(NavItem::forRoute((new Route(new InMemoryPage('foo'))))->isCurrent());
$this->assertFalse(NavItem::forRoute((new Route(new InMemoryPage('bar'))))->isCurrent());
$this->assertTrue(NavItem::forRoute(new Route(new InMemoryPage('foo')))->isCurrent());
$this->assertFalse(NavItem::forRoute(new Route(new InMemoryPage('bar')))->isCurrent());
}

public function testIsCurrentWithExternalRoute()
Expand All @@ -335,7 +335,7 @@ public function testGetGroupWithGroup()

public function testGetGroupFromRouteWithGroup()
{
$this->assertSame('foo', NavItem::forRoute((new Route(new MarkdownPage(matter: ['navigation.group' => 'foo']))))->getGroup());
$this->assertSame('foo', NavItem::forRoute(new Route(new MarkdownPage(matter: ['navigation.group' => 'foo'])))->getGroup());
}

public function testGetGroupForRouteWithGroup()
Expand Down

0 comments on commit 0e657ac

Please sign in to comment.