Make WordPress Core


Ignore:
Timestamp:
08/09/2024 06:29:47 PM (22 months 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/user/queryCache.php

    r57325 r58876  
    389389        $this->assertSameSets( $expected, $found, 'Find author in returned values' );
    390390
    391         wp_delete_user( $user_id );
     391        self::delete_user( $user_id );
    392392
    393393        $q2 = new WP_User_Query(
Note: See TracChangeset for help on using the changeset viewer.