summaryrefslogtreecommitdiffstatshomepage
path: root/tests/phpunit/includes/testcase-canonical.php
diff options
context:
space:
mode:
authorBoone Gorges <boonebgorges@git.wordpress.org>2014-11-08 19:55:05 +0000
committerBoone Gorges <boonebgorges@git.wordpress.org>2014-11-08 19:55:05 +0000
commit608084a9ccc3ab6e4b7b4b170ec3d50e39bb7e86 (patch)
tree9da86a537896fff142a3ea17d33b9f5883a07c20 /tests/phpunit/includes/testcase-canonical.php
parentd63ceb08a319385fb7590117a184112fe8c0bfcb (diff)
downloadwordpress-608084a9ccc3ab6e4b7b4b170ec3d50e39bb7e86.tar.gz
wordpress-608084a9ccc3ab6e4b7b4b170ec3d50e39bb7e86.zip
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
Diffstat (limited to 'tests/phpunit/includes/testcase-canonical.php')
-rw-r--r--tests/phpunit/includes/testcase-canonical.php6
1 files changed, 5 insertions, 1 deletions
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 );