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

[6.x] Add assertJsonPath #5493

Merged
merged 3 commits into from
Sep 27, 2019
Merged

[6.x] Add assertJsonPath #5493

merged 3 commits into from
Sep 27, 2019

Conversation

ahinkle
Copy link
Contributor

@ahinkle ahinkle commented Sep 25, 2019

Adds the new validation rule, assertJsonPath.

laravel/framework#29957

@ahinkle ahinkle changed the title Add assertJsonPath [6.x] Add assertJsonPath Sep 25, 2019
@taylorotwell
Copy link
Member

taylorotwell commented Sep 26, 2019

Could you flesh out the example a bit so it's clearer what you should be passing?

@ahinkle
Copy link
Contributor Author

ahinkle commented Sep 27, 2019

Will do. To keep the Available Assertions section uniform, I've added an example within the Testing JSON APIs section. Let me know if I need to provide any additional examples.

@taylorotwell taylorotwell merged commit 0db8852 into laravel:6.x Sep 27, 2019
@dailytabs
Copy link

dailytabs commented Sep 30, 2020

The documentation for this is pathetic. Standard json path notation starts with $. This is not supported and not documented. Array access is impossible to figure out. I just need to test that the first array item has a certain property and value.
[0].name is null
$[0].name is null
$.[0].name is null
.name is null
..name is null

I can dump my response and it's right there! 40 times in this array! Plain as day: "name": "value"

Like seriously, any explanation of WTF $path is would be...ya know, proper documentation!

EDIT: Found this comment on SO and thought it was funny: "6.3.3: throws an exception that decodeResponseJson() has been deprecated. Would check the doc but we all know how pointless that is..."

@ahinkle
Copy link
Contributor Author

ahinkle commented Oct 1, 2020

Feel free to open a new PR; suggesting that your entitled comment of "pathetic" doesn't help anyone.

@driesvints
Copy link
Member

@dailytabs can you please keep your comments more civil? Your remarks aren't helping anyone.

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.

4 participants