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
merged 1 commit into from
Jun 11, 2019
Merged

[5.8] Add message value assertion to assertJsonValidationErrors #28787

merged 1 commit into from
Jun 11, 2019

Conversation

ahinkle
Copy link
Contributor

@ahinkle ahinkle 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('key');
$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
Copy link
Member

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

image

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