Skip to content

Commit 15f655a

Browse files
committed
test: specify TestResponse type for better type safety
Signed-off-by: Pushpak Chhajed <[email protected]>
1 parent e8d6823 commit 15f655a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/Feature/Middleware/InjectBoostTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Http\Response;
77
use Illuminate\Support\Facades\Route;
88
use Illuminate\Support\Facades\Vite;
9+
use Illuminate\Testing\TestResponse;
910
use Laravel\Boost\Middleware\InjectBoost;
1011
use Symfony\Component\HttpFoundation\BinaryFileResponse;
1112
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -105,13 +106,13 @@ function createMiddlewareResponse($response): SymfonyResponse
105106
})->with([
106107
'with CSP nonce configured' => [
107108
'test-nonce',
108-
fn ($response) => $response
109+
fn (TestResponse $response) => $response
109110
->assertSee('nonce="test-nonce"', false)
110111
->assertSee('id="browser-logger-active"', false),
111112
],
112113
'without CSP nonce configured' => [
113114
null,
114-
fn ($response) => $response
115+
fn (TestResponse $response) => $response
115116
->assertSee('<script id="browser-logger-active">', false)
116117
->assertDontSee('nonce=', false)
117118
->assertDontSee('test-nonce', false),

0 commit comments

Comments
 (0)