Set current user to 0 after each unit test.
This prevents $current_user, $userdata, and other user-related globals from being polluted if a previous test does not properly reset the current user. Props nacin, mnelson4. Fixes #29712. git-svn-id: https://develop.svn.wordpress.org/trunk@30001 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9b3aabc7f9
commit
1fc0287164
@ -70,6 +70,7 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
remove_filter( 'query', array( $this, '_drop_temporary_tables' ) );
|
||||
remove_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) );
|
||||
$this->_restore_hooks();
|
||||
wp_set_current_user( 0 );
|
||||
}
|
||||
|
||||
function clean_up_global_scope() {
|
||||
|
Loading…
Reference in New Issue
Block a user