[wp-trac] [WordPress Trac] #29712: Restore $current_user between unit tests
WordPress Trac
noreply at wordpress.org
Fri Sep 19 19:41:23 UTC 2014
#29712: Restore $current_user between unit tests
-------------------------+------------------------------
Reporter: mnelson4 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by nacin):
For the most part, creating your ''own'' user is going to be preferred.
If you do need to set the current user for some reason, you should do
wp_set_current_user(), then call wp_set_current_user(0) in your tearDown.
We could do that in our own class's tearDown, we just haven't.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29712#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list