Skip to content

[11.x] json assertions on streamed content #54565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

gdebrauwer
Copy link
Contributor

Currently it is not possible to use all json assertions on a streamed json response. This PR fixes that.

Route::get('/users', function () {
    return response()->streamJson([
        'data' => User::cursor(),
    ]);
});
$this->getJson('/users')
    ->assertJsonCount(10, 'data')
    ->assertJsonPath('data.*.id', $users->pluck('id')->all());

gdebrauwer and others added 2 commits February 11, 2025 17:58

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@taylorotwell taylorotwell merged commit c1ed0ec into laravel:11.x Feb 11, 2025
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants