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.4] Add json alias for decodeResponseJson method #17735

Merged
merged 1 commit into from
Feb 2, 2017
Merged

[5.4] Add json alias for decodeResponseJson method #17735

merged 1 commit into from
Feb 2, 2017

Conversation

jerguslejko
Copy link
Contributor

This PR adds json() method to Illuminate\Foundation\Testing\TestResponse.

This method serves as an alias for decodeResponseJson() method.

It allows for nicer and much more intuitive API:

function it_gets_an_order_by_id()
{
    $order = $this->get('/orders/1')->decodeResponseJson();

    // vs

    $order = $this->get('/orders/1')->json();
}

🌵

@jerguslejko jerguslejko changed the title Add json alias for decodeResponseJson method [5.4] Add json alias for decodeResponseJson method Feb 2, 2017
@taylorotwell taylorotwell merged commit c224599 into laravel:5.4 Feb 2, 2017
@jerguslejko jerguslejko deleted the feature/json-alias branch February 2, 2017 19:44
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.

2 participants