Skip to content
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

[5.8] Make TestResponse tappable #29033

Merged
merged 1 commit into from Jul 3, 2019

Conversation

Projects
None yet
2 participants
@SjorsO
Copy link
Contributor

commented Jul 2, 2019

This PR adds the new tappable trait to the TestResponse. This way you can do stuff like this:

$this->getJson('/api/users/index')
    ->assertStatus(200)
    ->tap(function (TestResponse $response) {
        $this->assertMatchesJsonSnapshot($response);
    });

Instead of having to do:

$response = $this->getJson('/api/users/index')
    ->assertStatus(200);

$this->assertMatchesJsonSnapshot($response);

@taylorotwell taylorotwell merged commit 48ab29c into laravel:5.8 Jul 3, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.