diff --git a/tests/phpunit/includes/testcase.php b/tests/phpunit/includes/testcase.php index 35d0a62e54..b93149f4b1 100644 --- a/tests/phpunit/includes/testcase.php +++ b/tests/phpunit/includes/testcase.php @@ -597,4 +597,17 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { public function tear_down_wp_mail_globals() { unset( $_SERVER['SERVER_NAME'] ); } + + /** + * Multisite-agnostic way to delete a user from the database. + * + * @since 4.3.0 + */ + public static function delete_user( $user_id ) { + if ( is_multisite() ) { + return wpmu_delete_user( $user_id ); + } else { + return wp_delete_user( $user_id ); + } + } }