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] Add message value assertion to assertJsonValidationErrors #28787

merged 1 commit into from Jun 11, 2019


None yet
2 participants
Copy link

commented Jun 10, 2019

Resubmit of #27655.

This PR adds the assertion for JSON validation error messages in assertJsonValidationErrors.

Currently, we can only check json validation error keys:

$this->assertJsonValidationErrors(['foo', 'bar']);

With this addition, you will be able to check the key and the message:
$this->assertJsonValidationErrors(['key' => 'validation message']);

You can still continue to use the normal functionality by just passing a key, array of keys, or a mix of each.

@taylorotwell taylorotwell merged commit c73b5b8 into laravel:5.8 Jun 11, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed

This comment has been minimized.

Copy link

commented Jun 12, 2019

@ahinkle I shipped an augmentation to this method so that it handles arrays of error messages for a single key:


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.