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

Tests: use the correct parameter order #694

Merged
merged 1 commit into from
Aug 22, 2021

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Aug 21, 2021

For PHPUnit assertions which expect an $expected and a $result parameter, the parameter order is always `( $expected, $result, ...).

While it may not seem important to use the correct parameter order for assertions doing a straight comparison, in actual fact, it is.
The PHPUnit output when the assertions fail expects this order and the failure message will be reversed if the parameters are passed in reversed order which leads to confusion and makes it more difficult to debug a failing test.

Only three assertions in the test suite did not comply with this. Fixed now.

For PHPUnit assertions which expect an `$expected` and a `$result` parameter, the parameter order is always `( $expected, $result, ...).

While it may not seem important to use the correct parameter order for assertions doing a straight comparison, in actual fact, it is.
The PHPUnit output when the assertions fail expects this order and the failure message will be reversed if the parameters are passed in reversed order which leads to confusion and makes it more difficult to debug a failing test.

Only three assertions in the test suite did not comply with this. Fixed now.
@mblaney mblaney merged commit 707f256 into simplepie:master Aug 22, 2021
@jrfnl jrfnl deleted the feature/tests-correct-param-order branch August 22, 2021 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants