-
Notifications
You must be signed in to change notification settings - Fork 3.2k
#63167 Add assertions that test the tests. #1995
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
Conversation
jrfnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fully approve the direction of this PR. Left some remarks inline to iterate on this further.
|
Thanks for the comments @jrfnl , I've pushed some changes. I've left the whitespace unadjusted for now to keep the diff clean, the whitespace can be corrected at the point of commit. Next up, we've actually got some failures as a result of these additional assertions that need investigating. |
Nah, not test failures: test successes as making these changes has probably uncovered some bugs in the underlying code 😁 |
# Conflicts: # tests/phpunit/tests/ajax/MediaEdit.php # tests/phpunit/tests/import/parser.php # tests/phpunit/tests/media.php
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Several tests perform assertions conditionally or iterate dynamic arrays without ensuring they're populated. If the test is faulty and the condition never evaluates to true or the array being iterated is empty then we'll never know about it.
This adds additional assertions that cover these situations.
Trac ticket: https://core.trac.wordpress.org/ticket/63167