Make WordPress Core


Ignore:
Timestamp:
05/26/2025 02:34:12 PM (8 months ago)
Author:
johnbillion
Message:

Build/Test Tools: Increase shared user fixtures following switch to bcrypt hashing.

User creation is somewhat more expensive since switching the default password hashing algorithm to bcrypt in 6.8. This speeds up the tests by making more use of shared user fixtures, thus reducing the number of users that are created during tests.

Props peterwilsoncc.

See #63026

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user.php

    r60250 r60253  
    10841084     */
    10851085    public function test_wp_update_user_should_delete_userslugs_cache() {
    1086         $u    = self::factory()->user->create();
     1086        $u    = self::$sub_id;
    10871087        $user = get_userdata( $u );
    10881088
     
    19401940        $_REQUEST = array();
    19411941
    1942         $administrator = self::factory()->user->create(
    1943             array(
    1944                 'role' => 'administrator',
    1945             )
    1946         );
     1942        $administrator = self::$admin_id;
    19471943
    19481944        wp_set_current_user( $administrator );
     
    19581954
    19591955        // Promote an editor to an administrator.
    1960         $editor = self::factory()->user->create(
    1961             array(
    1962                 'role' => 'editor',
    1963             )
    1964         );
     1956        $editor = self::$editor_id;
    19651957
    19661958        $_POST['role']     = 'administrator';
Note: See TracChangeset for help on using the changeset viewer.