From 75fc296b167e9f1f3ea83675eb76ace0b737e499 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Thu, 25 Jul 2024 11:10:18 +0200 Subject: [PATCH] Update unit test to mock the kernel routes --- packages/framework/tests/Unit/IncludesFacadeUnitTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/framework/tests/Unit/IncludesFacadeUnitTest.php b/packages/framework/tests/Unit/IncludesFacadeUnitTest.php index 1da30c9d435..6dac17db2f5 100644 --- a/packages/framework/tests/Unit/IncludesFacadeUnitTest.php +++ b/packages/framework/tests/Unit/IncludesFacadeUnitTest.php @@ -9,9 +9,12 @@ use Hyde\Hyde; use Hyde\Support\Includes; use Hyde\Testing\UnitTestCase; +use Hyde\Support\Facades\Render; use Illuminate\Support\HtmlString; +use Hyde\Support\Models\RenderData; use Illuminate\Support\Facades\Blade; use Illuminate\Filesystem\Filesystem; +use Hyde\Testing\MocksKernelFeatures; /** * @covers \Hyde\Support\Includes @@ -20,6 +23,8 @@ */ class IncludesFacadeUnitTest extends UnitTestCase { + use MocksKernelFeatures; + protected static bool $needsKernel = true; protected static bool $needsConfig = true; @@ -28,6 +33,10 @@ protected function setUp(): void parent::setUp(); Blade::swap(Mockery::mock()); + + $this->setupTestKernel(); + $this->kernel->setRoutes(collect()); + Render::swap(new RenderData()); } protected function tearDown(): void