From 608084a9ccc3ab6e4b7b4b170ec3d50e39bb7e86 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Sat, 8 Nov 2014 19:55:05 +0000 Subject: [PATCH] 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 --- tests/phpunit/includes/testcase-canonical.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/testcase-canonical.php b/tests/phpunit/includes/testcase-canonical.php index f36e2bf6ee..3c6e45d948 100644 --- a/tests/phpunit/includes/testcase-canonical.php +++ b/tests/phpunit/includes/testcase-canonical.php @@ -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 );