Skip to content

Commit 1e84624

Browse files
committed
Fix tests
1 parent d536a89 commit 1e84624

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/Fixtures/TestController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Routing\Controller;
77
use Illuminate\Validation\Rule;
88
use Knuckles\Scribe\Tools\Utils;
9+
use Symfony\Component\HttpFoundation\StreamedJsonResponse;
910

1011
/**
1112
* @group Group A
@@ -260,7 +261,8 @@ function yieldItems() {
260261
yield 'one';
261262
yield 'two';
262263
}
263-
return response()->streamJson([
264+
// Laravel v11 added the shortcut response()->streamJson(...)
265+
return new StreamedJsonResponse([
264266
'items' => yieldItems(),
265267
]);
266268
}

tests/Strategies/Responses/ResponseCallsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ public function can_get_content_from_streamed_response()
177177
{
178178
$route = LaravelRouteFacade::post('/withStreamedResponse', [TestController::class, 'withStreamedResponse']);
179179

180+
$this->withoutExceptionHandling();
180181
$responses = $this->invokeStrategy($route);
181182

182183
$this->assertEquals(200, $responses[0]['status']);

0 commit comments

Comments
 (0)