Skip to content

Commit

Permalink
Update test to use mocking helper
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Sep 8, 2024
1 parent 880eebe commit a3cae27
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/framework/tests/Unit/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

use Hyde\Hyde;
use Hyde\Pages\MarkdownPage;
use Hyde\Support\Facades\Render;
use Hyde\Support\Models\RenderData;
use Hyde\Support\Models\Route;
use Hyde\Support\Models\RouteKey;
use Hyde\Testing\UnitTestCase;
Expand All @@ -21,7 +19,7 @@ protected function setUp(): void
{
self::setupKernel();
self::mockConfig();
Render::swap(new RenderData());
self::mockCurrentRouteKey();
}

public function testConstructorCreatesRouteFromPageModel()
Expand Down Expand Up @@ -80,7 +78,7 @@ public function testGetLinkReturnsCorrectPathForNestedPages()
public function testGetLinkReturnsCorrectPathForNestedCurrentPage()
{
$route = new Route(new MarkdownPage('foo'));
Render::shouldReceive('getRouteKey')->andReturn('foo/bar');
self::mockCurrentRouteKey('foo/bar');

$this->assertSame(Hyde::relativeLink($route->getOutputPath()), $route->getLink());
$this->assertSame('../foo.html', $route->getLink());
Expand Down

0 comments on commit a3cae27

Please sign in to comment.