Repository navigation
Tests: Use assertNotSame() for user meta query login comparison. - #14855
Draft
shail-mehta wants to merge 1 commit into
Draft
shail-mehta wants to merge 1 commit into
shail-mehta wants to merge 1 commit into
Conversation
Part of #64895: user_login values are strings, so strict inequality is appropriate.
There was a problem hiding this comment.
🟢 Approval recommended
Both operands are login strings, so the strict assertion preserves the intended check without introducing a correctness issue.
No open issues 🎉
What changed in this PR
Updates the user metadata query test to use a strict comparison for login strings, aligning with WordPress ticket #64895.
Changes:
- Replaces
assertNotEquals()withassertNotSame()intest_user_metadata_not_exists(). - Leaves all other assertions unchanged.
| File | Description |
|---|---|
tests/phpunit/tests/meta.php |
Uses strict inequality for the author and found-user login comparison. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of: #64895
What
Replaces the remaining
assertNotEquals()call intests/phpunit/tests/meta.phpwithassertNotSame()for the user login comparison.Updated method:
test_user_metadata_not_exists():assertNotEquals→assertNotSameforuser_loginWhy
#64895 asks for strict assertions when both sides share a type. These are
user_loginstrings, soassertNotSame()is appropriate.How
assertNotEquals()toassertNotSame()Testing instructions
npm run test:php -- --filter test_user_metadata_not_existsUse of AI tools
Cursor