Skip to content

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

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

@AhmedHelalAhmed AhmedHelalAhmed commented Sep 18, 2021

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
@AhmedHelalAhmed AhmedHelalAhmed changed the title Fix consistency of assertJsonPath to act like assertSame so that expected value be first parameter [8.x] Fix consistency of assertJsonPath to act like assertSame so that expected value be first parameter Sep 18, 2021
Copy link
Contributor

@kylekatarnls kylekatarnls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve this change but I would target it for 9.x as it's a breaking change.

@AhmedHelalAhmed AhmedHelalAhmed changed the title [8.x] Fix consistency of assertJsonPath to act like assertSame so that expected value be first parameter [9.x] Fix consistency of assertJsonPath to act like assertSame so that expected value be first parameter Sep 18, 2021
@AhmedHelalAhmed
Copy link
Author

@kylekatarnls Thank you. title modified

@AhmedHelalAhmed AhmedHelalAhmed changed the base branch from 8.x to master September 18, 2021 12:32
@AhmedHelalAhmed AhmedHelalAhmed changed the base branch from master to 8.x September 18, 2021 12:33
@Jubeki
Copy link
Contributor

Jubeki commented Sep 18, 2021

You should also change the base branch to master. (You probably should open a new PR where you branch of the master branch and change the code there.)

@AhmedHelalAhmed
Copy link
Author

@Jubeki OK got it

@AhmedHelalAhmed
Copy link
Author

@kylekatarnls @Jubeki
Here is the new pull request from master to master
#38856

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