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.7] allow 'assertJsonMissingValidationErrors' to be called without an argument #27176

Merged
merged 2 commits into from Jan 16, 2019

Conversation

Projects
None yet
2 participants
@SjorsO
Copy link
Contributor

SjorsO commented Jan 15, 2019

This PR is a different implementation of #27172

This PR makes calling assertJsonMissingValidationErrors without an argument behave the same as as assertSessionHasNoErrors() (but it works for Json responses, since they don't store their errors in session).

Example:

$this->post(route('api.users.store'), $data)
    ->assertJsonMissingValidationErrors()
    ->assertStatus(201);

If this test has validation errors, it will print them to the console. If you would write the same test without the assertJsonMissingValidationErrors(), and then you get validation errors, the test will only print an unhelpful "expected status 201 but received 422".

SjorsO and others added some commits Jan 15, 2019

@taylorotwell taylorotwell merged commit 990d867 into laravel:5.7 Jan 16, 2019

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/styleci/pr The analysis has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment