From 67f4adb5e7e91910de123753201a7c3b2c1fe3f3 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sat, 21 Dec 2024 21:04:24 +0100 Subject: [PATCH] Merge --- tests/Unit/AssetServiceUnitTest.php | 2 +- tests/Unit/BaseFoundationCollectionTest.php | 2 +- tests/Unit/BreadcrumbsComponentTest.php | 2 +- tests/Unit/BuildTaskUnitTest.php | 4 ++-- tests/Unit/HtmlTestingSupportMetaTest.php | 4 +--- tests/Unit/NavItemTest.php | 7 +++++-- tests/Unit/NavigationDataFactoryUnitTest.php | 2 +- tests/Unit/UnixsumTest.php | 2 +- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/Unit/AssetServiceUnitTest.php b/tests/Unit/AssetServiceUnitTest.php index e9f4809b..4554ec53 100644 --- a/tests/Unit/AssetServiceUnitTest.php +++ b/tests/Unit/AssetServiceUnitTest.php @@ -17,7 +17,7 @@ class AssetServiceUnitTest extends UnitTestCase { protected function setUp(): void { - self::setupKernel(); + self::resetKernel(); self::mockConfig(); } diff --git a/tests/Unit/BaseFoundationCollectionTest.php b/tests/Unit/BaseFoundationCollectionTest.php index cdcc215d..95725ec5 100644 --- a/tests/Unit/BaseFoundationCollectionTest.php +++ b/tests/Unit/BaseFoundationCollectionTest.php @@ -17,7 +17,7 @@ class BaseFoundationCollectionTest extends UnitTestCase { public function testBaseFoundationCollectionInitialization() { - $this->setupKernel(); + self::resetKernel(); $booted = BaseFoundationCollectionTestClass::init(HydeKernel::getInstance())->boot(); diff --git a/tests/Unit/BreadcrumbsComponentTest.php b/tests/Unit/BreadcrumbsComponentTest.php index ffd7c29f..dc5231ad 100644 --- a/tests/Unit/BreadcrumbsComponentTest.php +++ b/tests/Unit/BreadcrumbsComponentTest.php @@ -23,7 +23,7 @@ class BreadcrumbsComponentTest extends UnitTestCase { protected function setUp(): void { - self::setupKernel(); + self::resetKernel(); self::mockConfig(); } diff --git a/tests/Unit/BuildTaskUnitTest.php b/tests/Unit/BuildTaskUnitTest.php index be9aec94..45127d4d 100644 --- a/tests/Unit/BuildTaskUnitTest.php +++ b/tests/Unit/BuildTaskUnitTest.php @@ -153,7 +153,7 @@ public function testCanWriteToOutput() public function testCreatedSiteFile() { - self::setupKernel(); + self::resetKernel(); $task = new BufferedTestBuildTask(); @@ -164,7 +164,7 @@ public function testCreatedSiteFile() public function testCreatedSiteFileWithAbsolutePath() { - self::setupKernel(); + self::resetKernel(); $task = new BufferedTestBuildTask(); diff --git a/tests/Unit/HtmlTestingSupportMetaTest.php b/tests/Unit/HtmlTestingSupportMetaTest.php index 491400cd..3c109d74 100644 --- a/tests/Unit/HtmlTestingSupportMetaTest.php +++ b/tests/Unit/HtmlTestingSupportMetaTest.php @@ -31,9 +31,7 @@ class HtmlTestingSupportMetaTest extends UnitTestCase protected function setUp(): void { - parent::setUp(); - - self::setupKernel(); + self::resetKernel(); $this->html ??= file_get_contents(Hyde::vendorPath('resources/views/homepages/welcome.blade.php')); } diff --git a/tests/Unit/NavItemTest.php b/tests/Unit/NavItemTest.php index 94811a94..e4dbb2f9 100644 --- a/tests/Unit/NavItemTest.php +++ b/tests/Unit/NavItemTest.php @@ -25,8 +25,11 @@ */ class NavItemTest extends UnitTestCase { - protected static bool $needsKernel = true; - protected static bool $needsConfig = true; + public static function setUpBeforeClass(): void + { + self::resetKernel(); + self::mockConfig(); + } protected function setUp(): void { diff --git a/tests/Unit/NavigationDataFactoryUnitTest.php b/tests/Unit/NavigationDataFactoryUnitTest.php index 6833cacd..c5f3524f 100644 --- a/tests/Unit/NavigationDataFactoryUnitTest.php +++ b/tests/Unit/NavigationDataFactoryUnitTest.php @@ -19,7 +19,7 @@ class NavigationDataFactoryUnitTest extends UnitTestCase { protected function setUp(): void { - self::setupKernel(); + self::resetKernel(); self::mockConfig(); } diff --git a/tests/Unit/UnixsumTest.php b/tests/Unit/UnixsumTest.php index 0a001538..81b800ed 100644 --- a/tests/Unit/UnixsumTest.php +++ b/tests/Unit/UnixsumTest.php @@ -63,7 +63,7 @@ public function testMethodReturnsSameValueForStringWithMixedEndOfLineSequences() public function testMethodReturnsSameValueWhenLoadedFromFileUsingShorthand() { - self::setupKernel(); + self::resetKernel(); $string = "foo\nbar\r\nbaz\r\n";