Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Feb 25, 2025
1 parent d536a89 commit 1e84624
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Fixtures/TestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Routing\Controller;
use Illuminate\Validation\Rule;
use Knuckles\Scribe\Tools\Utils;
use Symfony\Component\HttpFoundation\StreamedJsonResponse;

/**
* @group Group A
Expand Down Expand Up @@ -260,7 +261,8 @@ function yieldItems() {
yield 'one';
yield 'two';
}
return response()->streamJson([
// Laravel v11 added the shortcut response()->streamJson(...)
return new StreamedJsonResponse([
'items' => yieldItems(),
]);
}
Expand Down
1 change: 1 addition & 0 deletions tests/Strategies/Responses/ResponseCallsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public function can_get_content_from_streamed_response()
{
$route = LaravelRouteFacade::post('/withStreamedResponse', [TestController::class, 'withStreamedResponse']);

$this->withoutExceptionHandling();
$responses = $this->invokeStrategy($route);

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

0 comments on commit 1e84624

Please sign in to comment.