Opened 12 years ago
Closed 12 years ago
#21742 closed enhancement (fixed)
Allow unit tests to override is_*_admin()
Reported by: | ryan | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.4.1 |
Component: | Unit Tests | Keywords: | |
Focuses: | Cc: |
Description
Unit tests sometimes need to fake being in the user, network, or blog admin or on the front page. This is currently impossible due to the use of constants. A possible solution is to consult the current screen if it is setup and fallback to the constants otherwise. Alternatively, add filters in the is_*_admin() functions.
Attachments (6)
Change History (11)
Note: See
TracTickets for help on using
tickets.
Rough take on using WP_Screen