Repository navigation
Tests: Use assertNotSame() for admin bar profile URL comparisons. - #14853
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: these comparisons are URL strings, so strict inequality is appropriate.
There was a problem hiding this comment.
🟢 Approval recommended
Both comparisons use URL strings, so strict inequality preserves the intended checks without identified correctness issues.
No open issues 🎉
What changed in this PR
This PR updates two admin bar tests to use strict inequality assertions for profile URL strings. No production code changes are included.
Changes:
- Replace two
assertNotEquals()calls withassertNotSame(). - Leave all other assertions unchanged.
| File | Description |
|---|---|
tests/phpunit/tests/adminbar.php |
Use strict inequality for two profile URL comparisons. |
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()calls intests/phpunit/tests/adminbar.phpwithassertNotSame()for profile URL comparisons.Updated methods:
test_admin_bar_contains_correct_links_for_users_with_no_role():assertNotEquals→assertNotSametest_admin_bar_contains_correct_links_for_users_with_no_role_on_network():assertNotEquals→assertNotSameWhy
These comparisons are URL strings (
get_admin_url()/user_admin_url()vsadmin_url()), soassertNotSame()is appropriate. Same approach as [r63632] / [r64079].How
assertNotEquals()toassertNotSame()Testing instructions
npm run test:php -- --filter Tests_AdminBarnpm run test:php -- --group ms-required --filter Tests_AdminBarUse of AI tools
Cursor