From 09b5c45b2f8fe09adff8454820346d0ade02f36c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 5 Jul 2024 19:09:22 +0200 Subject: [PATCH] Add semantic testing helper to reset the kernel --- packages/testing/src/UnitTestCase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/testing/src/UnitTestCase.php b/packages/testing/src/UnitTestCase.php index cb0b4a48a43..23e6083a903 100644 --- a/packages/testing/src/UnitTestCase.php +++ b/packages/testing/src/UnitTestCase.php @@ -40,6 +40,11 @@ protected static function setupKernel(): void self::$hasSetUpKernel = true; } + protected static function resetKernel(): void + { + HydeKernel::setInstance(new HydeKernel()); + } + protected static function mockConfig(array $items = []): void { app()->bind('config', fn (): Repository => new Repository($items));