[wp-trac] [WordPress Trac] #22895: user_can_admin_menu() is Type-Insensitive for Users who Can't Create Pages

WordPress Trac noreply at wordpress.org
Mon Jun 8 21:11:03 UTC 2015


#22895: user_can_admin_menu() is Type-Insensitive for Users who Can't Create Pages
------------------------------------+-----------------------------
 Reporter:  kevinB                  |       Owner:  johnbillion
     Type:  defect (bug)            |      Status:  accepted
 Priority:  normal                  |   Milestone:  Future Release
Component:  Role/Capability         |     Version:  3.5
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+-----------------------------
Changes (by joshlevinson):

 * keywords:  has-patch needs-testing needs-unit-tests => has-patch dev-
     feedback


Comment:

 I've added a test to cover this specific ticket. A couple notes:
 - The test doesn't provide full coverage for `user_can_access_admin_page`;
 it just verifies that `22895.3.diff` works as intended in a
 straightforward way.
 - Since the admin menu functionality involves the use of globals ''and''
 modifying those globals directly in various files (vs. function bodies), a
 lot of code from the menu "API" had to be brought within this test. I'm
 sure that once progress is made on #12718, this will change. Disclaimer:
 I'm a novice unit tester, so there may be a better way than how I managed
 to do this. I couldn't think of one.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/22895#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list