Skip to content

[9.x] Fix consistency of assertJsonPath to act like assertSame so that expected value be first parameter #38856

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

Closed
wants to merge 4 commits into from

Conversation

AhmedHelalAhmed
Copy link

This PR fix consistency of assertJsonPath to act like assertSame so that the expected value be the first parameter

// Take expected value first then the key
assertJsonCount($expected, $key)

// Take expected value first then the path
assertSame($expected, $path)

// So why we don't make assertJsonPath take expected as first parameters to be consistent 
assertJsonPath($expected, $path)`

…cted value be first parameter

- Fix consistency to be like assertSame the expected to be first
parameter
- Similar to assertJsonCount with provide expected first
@kylekatarnls
Copy link
Contributor

kylekatarnls commented Sep 18, 2021

For the record the failure here is not related to the current changes.

These would be fixed by #38852

@AhmedHelalAhmed
Copy link
Author

@kylekatarnls Thank you for the clarification

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!

If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.

@AhmedHelalAhmed
Copy link
Author

AhmedHelalAhmed commented Sep 18, 2021

@taylorotwell
This modification mentioned by @themsaid in the stream in https://youtu.be/4yuVKMUnOf8 in Laravel official channel
and I'm happy to contribute to my favourite framework I mentioned to not duplicate the work and it's fine
Thanks

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.

3 participants