From 57be59e055d15eff1111c5d81caaffb0895b508c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 8 Sep 2024 17:23:50 +0200 Subject: [PATCH] Use the new render mocking helpers --- packages/framework/tests/Unit/IncludesFacadeUnitTest.php | 2 +- packages/framework/tests/Unit/NavigationItemTest.php | 6 +----- packages/framework/tests/Unit/RenderHelperTest.php | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/framework/tests/Unit/IncludesFacadeUnitTest.php b/packages/framework/tests/Unit/IncludesFacadeUnitTest.php index 6dac17db2f5..ef975ebcbed 100644 --- a/packages/framework/tests/Unit/IncludesFacadeUnitTest.php +++ b/packages/framework/tests/Unit/IncludesFacadeUnitTest.php @@ -27,6 +27,7 @@ class IncludesFacadeUnitTest extends UnitTestCase protected static bool $needsKernel = true; protected static bool $needsConfig = true; + protected static bool $needsRender = true; protected function setUp(): void { @@ -36,7 +37,6 @@ protected function setUp(): void $this->setupTestKernel(); $this->kernel->setRoutes(collect()); - Render::swap(new RenderData()); } protected function tearDown(): void diff --git a/packages/framework/tests/Unit/NavigationItemTest.php b/packages/framework/tests/Unit/NavigationItemTest.php index 22742802644..b4b781ac125 100644 --- a/packages/framework/tests/Unit/NavigationItemTest.php +++ b/packages/framework/tests/Unit/NavigationItemTest.php @@ -31,11 +31,7 @@ public static function setUpBeforeClass(): void self::needsKernel(); self::mockConfig(); - } - - protected function setUp(): void - { - Render::swap(new RenderData()); + self::mockRender(); } public function testConstruct() diff --git a/packages/framework/tests/Unit/RenderHelperTest.php b/packages/framework/tests/Unit/RenderHelperTest.php index ee0cc280ecb..be9d14076af 100644 --- a/packages/framework/tests/Unit/RenderHelperTest.php +++ b/packages/framework/tests/Unit/RenderHelperTest.php @@ -26,9 +26,8 @@ class RenderHelperTest extends UnitTestCase protected function setUp(): void { - parent::setUp(); + self::mockRender(); - Render::swap(new RenderData()); View::swap(Mockery::mock(Factory::class)->makePartial()); }