Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/framework/tests/Unit/IncludesFacadeUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
use Hyde\Support\Includes;
use AllowDynamicProperties;
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;
Expand All @@ -29,14 +27,13 @@ class IncludesFacadeUnitTest extends UnitTestCase

protected static bool $needsKernel = true;
protected static bool $needsConfig = true;
protected static bool $needsRender = true;

protected function setUp(): void
{
Blade::swap(Mockery::mock());

$this->setupTestKernel();
$this->kernel->setRoutes(collect());
Render::swap(new RenderData());
$this->setupTestKernel()->setRoutes(collect());
}

protected function tearDown(): void
Expand Down
4 changes: 3 additions & 1 deletion packages/testing/src/MocksKernelFeatures.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ protected function withPages(array $pages): static
return $this;
}

protected function setupTestKernel(): void
protected function setupTestKernel(): TestKernel
{
$this->kernel = new TestKernel();

HydeKernel::setInstance($this->kernel);

return $this->kernel;
}
}

Expand Down