In unit tests, use wpmu_delete_user()
to delete users when is_multisite()
.
`wp_delete_user()` doesn't remove the user from the database, which causes all sorts of problems in certain cases. Props jeremyfelt. See [30277], #30017. git-svn-id: https://develop.svn.wordpress.org/trunk@30278 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d63ceb08a3
commit
608084a9cc
@ -116,7 +116,11 @@ class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
|
||||
public static function delete_shared_fixtures() {
|
||||
global $wp_rewrite;
|
||||
|
||||
wp_delete_user( self::$author_id );
|
||||
if ( is_multisite() ) {
|
||||
wpmu_delete_user( self::$author_id );
|
||||
} else {
|
||||
wp_delete_user( self::$author_id );
|
||||
}
|
||||
|
||||
foreach ( self::$post_ids as $pid ) {
|
||||
wp_delete_post( $pid, true );
|
||||
|
Loading…
Reference in New Issue
Block a user