Skip to content

Commit

Permalink
Extract fluent alias
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Sep 8, 2024
1 parent 9705989 commit 857d2a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/framework/tests/Unit/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RouteTest extends UnitTestCase

protected function setUp(): void
{
self::mockCurrentRouteKey();
self::mockRender();
}

public function testConstructorCreatesRouteFromPageModel()
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/src/Common/BaseHydePageUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function setUp(): void
{
self::setupKernel();
self::mockConfig();
self::mockCurrentRouteKey();
self::mockRender();

View::swap($mock = Mockery::mock(Factory::class, [
'make' => Mockery::mock(Factory::class, [
Expand Down
7 changes: 6 additions & 1 deletion packages/testing/src/UnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function setUpBeforeClass(): void
}

if (static::$needsRender) {
self::mockCurrentRouteKey();
self::mockRender();
}
}

Expand All @@ -52,6 +52,11 @@ protected static function resetKernel(): void
HydeKernel::setInstance(new HydeKernel());
}

protected static function mockRender(): void
{
Render::swap(new RenderData());
}

protected static function mockConfig(array $items = []): void
{
app()->bind('config', fn (): Repository => new Repository($items));
Expand Down

0 comments on commit 857d2a9

Please sign in to comment.