From 42e7df868250e1b5b2d00c93b0257f4776193256 Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Thu, 24 Aug 2023 10:13:43 +0100 Subject: [PATCH] Updated testSpatieLaravelIgnitionCompatibility test as lastCompiled is now a real protected property on the test harness --- .../Engine/ScoutViewEngineDecoratorTest.php | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/tests/Unit/Laravel/View/Engine/ScoutViewEngineDecoratorTest.php b/tests/Unit/Laravel/View/Engine/ScoutViewEngineDecoratorTest.php index 45a434d2..75ef1334 100644 --- a/tests/Unit/Laravel/View/Engine/ScoutViewEngineDecoratorTest.php +++ b/tests/Unit/Laravel/View/Engine/ScoutViewEngineDecoratorTest.php @@ -173,25 +173,20 @@ public function testScoutViewEngineDecoratorImplementsAllPublicApiOfCompilerEngi } } + /** + * The `spatie/laravel-ignition` package depends on the engine having a property called `lastCompiled`, which + * only exists in the `\Illuminate\View\Engines\CompilerEngine` Blade Compiler. The implementation does sort of + * account for decoration, but it expects the property to be called `engine`. Therefore, in this test, we + * invoke the problematic consumer to ensure our decorated view engine conforms to this assumption. + * + * @link https://github.com/spatie/laravel-ignition/blob/d53075177ee0c710fbf588b8569f50435e1da054/src/Views/ViewExceptionMapper.php#L124-L130 + */ public function testSpatieLaravelIgnitionCompatibility(): void { if (! class_exists(ViewExceptionMapper::class)) { self::markTestSkipped('Test depends on `spatie/laravel-ignition`, but it is not installed'); } - /** - * The `spatie/laravel-ignition` package depends on the engine having a property called `lastCompiled`, which - * only exists in the `\Illuminate\View\Engines\CompilerEngine` Blade Compiler. The implementation does sort of - * account for decoration, but it expects the property to be called `engine`. Therefore, in this test, we - * invoke the problematic consumer to ensure our decorated view engine conforms to this assumption. - * - * @link https://github.com/spatie/laravel-ignition/blob/d53075177ee0c710fbf588b8569f50435e1da054/src/Views/ViewExceptionMapper.php#L124-L130 - * - * @noinspection PhpPossiblePolymorphicInvocationInspection - * @psalm-suppress NoInterfaceProperties - */ - $this->realEngine->lastCompiled = []; - $viewEngineResolver = new EngineResolver(); $viewEngineResolver->register('blade', function () { return $this->viewEngineDecorator;