From cb7e1c7e6ee80cc56ffb0bae022dad6a302f1996 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 10 Jul 2024 12:57:02 +0200 Subject: [PATCH] Refactor unit test to use the unit test case --- .../tests/Unit/Facades/AuthorTest.php | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/framework/tests/Unit/Facades/AuthorTest.php b/packages/framework/tests/Unit/Facades/AuthorTest.php index b15dec9a55f..8c61b3e5993 100644 --- a/packages/framework/tests/Unit/Facades/AuthorTest.php +++ b/packages/framework/tests/Unit/Facades/AuthorTest.php @@ -4,15 +4,31 @@ namespace Hyde\Framework\Testing\Unit\Facades; +use Hyde\Hyde; use Hyde\Facades\Author; use Hyde\Framework\Features\Blogging\Models\PostAuthor; -use Hyde\Testing\TestCase; +use Hyde\Testing\UnitTestCase; /** * @covers \Hyde\Facades\Author */ -class AuthorTest extends TestCase +class AuthorTest extends UnitTestCase { + protected static bool $needsKernel = true; + + protected function setUp(): void + { + parent::setUp(); + + static $config = null; + + if ($config === null) { + $config = require_once Hyde::path('config/hyde.php'); + } + + self::mockConfig(['hyde' => $config]); + } + public function testCreate() { $author = Author::create('John Doe', 'https://johndoe.com');