Make WordPress Core


Ignore:
Timestamp:
08/09/2024 06:29:47 PM (2 years ago)
Author:
flixos90
Message:

Build/Test Tools: Avoid using wp_delete_user() in PHPUnit tests unless explicitly acknowledging or ignoring Multisite.

wp_delete_user() does not actually delete the entire user when using WordPress Multisite. Therefore tests should typically use the test helper method to fully delete the user, unless explicitly ignoring Multisite or testing the wp_delete_user() function while taking Multisite behavior into account.

Fixes #61851.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-sidebars-controller.php

    r56549 r58876  
    4444
    4545        public static function wpTearDownAfterClass() {
    46                 wp_delete_user( self::$admin_id );
    47                 wp_delete_user( self::$author_id );
     46                self::delete_user( self::$admin_id );
     47                self::delete_user( self::$author_id );
    4848        }
    4949
Note: See TracChangeset for help on using the changeset viewer.