Repository navigation
Tests: Use assertNotSame() for user meta query login comparison. - #14855
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
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
lancewillett
left a comment
There was a problem hiding this comment.
Both operands are user-login strings. The strict comparison preserves the check that the meta query excludes the fixture author.
Unit-tests audit completed. Combined randomized runs passed: single-site 497 tests / 1,609 assertions; multisite 521 tests / 1,694 assertions, with one skip in each run. PHPCS and CI passed. Copilot has no open findings.
AI review · gpt-6
|
PR #14855 landed in https://core.trac.wordpress.org/changeset/64782 |
Use `assertNotSame()` when checking that a `NOT EXISTS` user meta query excludes the fixture author. Developed in: #14855 Props shailu25. See #64895. git-svn-id: https://develop.svn.wordpress.org/trunk@64783 602fd350-edb4-49c9-b593-d223f7449a82
Use `assertNotSame()` when checking that a `NOT EXISTS` user meta query excludes the fixture author. Developed in: WordPress/wordpress-develop#14855 Props shailu25. See #64895. Built from https://develop.svn.wordpress.org/trunk@64783 git-svn-id: http://core.svn.wordpress.org/trunk@63933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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