From 75360c742266d42616423bd75786c4719e4b8e41 Mon Sep 17 00:00:00 2001 From: "Sebastian BURGIN-FIX (ext)" Date: Sun, 25 Oct 2026 02:11:37 +0100 Subject: [PATCH] test(analytics): use Pest's function helpers in the zunscan test Larastan analyses the tests and does not know $this inside the Pest closure (4 errors in ci larastan on #132). Use Pest\Laravel\get() and withoutVite() instead, as the rest of the suite does. Co-Authored-By: Claude Opus 5.5 --- tests/Feature/Views/CodebarAnalyticsPartialTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/Feature/Views/CodebarAnalyticsPartialTest.php b/tests/Feature/Views/CodebarAnalyticsPartialTest.php index d796adb..0aff125 100644 --- a/tests/Feature/Views/CodebarAnalyticsPartialTest.php +++ b/tests/Feature/Views/CodebarAnalyticsPartialTest.php @@ -4,6 +4,9 @@ use Illuminate\Support\Facades\Config; +use function Pest\Laravel\get; +use function Pest\Laravel\withoutVite; + it('embeds the codebar analytics script in production', function () { Config::set('default.services.codebar_analytics.url', 'https://analytics.codebar.ch'); app()['env'] = 'production'; @@ -26,11 +29,11 @@ })->group('analytics'); it('embeds the codebar analytics script on zunscan.codebar.ch in production', function () { - $this->withoutVite(); + withoutVite(); Config::set('default.services.codebar_analytics.url', 'https://analytics.codebar.ch'); app()->detectEnvironment(fn () => 'production'); - $this->get('http://zunscan.codebar.ch/de-ch') + get('http://zunscan.codebar.ch/de-ch') ->assertOk() ->assertSee('', false); })->group('analytics');