[wp-trac] [WordPress Trac] #38433: Complete test coverage for current_user_can_for_site() (was: Complete test coverage for current_user_can_for_blog())
WordPress Trac
noreply at wordpress.org
Tue Aug 12 09:41:27 UTC 2025
#38433: Complete test coverage for current_user_can_for_site()
-------------------------------------------------+-------------------------
Reporter: johnbillion | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future
| Release
Component: Role/Capability | Version: 4.3
Severity: normal | Resolution:
Keywords: good-first-bug has-patch has-unit- | Focuses:
tests |
-------------------------------------------------+-------------------------
Changes (by johnbillion):
* keywords: needs-unit-tests good-first-bug has-patch needs-dev-note =>
good-first-bug has-patch has-unit-tests
Old description:
> In `Tests_User_Capabilities`, all roles and capabilities are tested using
> `current_user_can()`. They should all be tested using
> `current_user_can_for_blog()`, too.
New description:
In `Tests_User_Capabilities`, all roles and capabilities are tested using
`current_user_can()`. They should all be tested using
`current_user_can_for_site()`, too.
--
Comment:
Thanks so much for the patch @sachinrajcp123 . Would you like to
[https://make.wordpress.org/core/handbook/contribute/git/github-pull-
requests-for-code-review/ open a GitHub pull request with those changes]
please so the test suite can run?
Also the function has been deprecated since this ticket was opened so I've
changed the title. The preferred function name is now
`current_user_can_for_site()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38433#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list