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.7] Improve assertJsonValidationErrors error message, make it fail when no keys given #27495

Merged
merged 2 commits into from
Feb 12, 2019

Conversation

SjorsO
Copy link
Contributor

@SjorsO SjorsO commented Feb 12, 2019

Currently, when the assertJsonValidationErrors assertion fails, it prints the following unhelpful error message:

image

This PR makes it output the validation errors that are present. This makes it easier to figure out what is going on.

image

If the response has no json validation errors, it will show this instead:

image

This PR also makes the assertion fail if you don't give the assertions any keys to expect. Currently if you pass in an empty array, the method won't make any assertion and just keep going.

@taylorotwell taylorotwell merged commit f7437e1 into laravel:5.7 Feb 12, 2019
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