Make WordPress Core


Ignore:
Timestamp:
05/26/2025 02:34:12 PM (9 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/auth.php

    r60124 r60253  
    15801580     */
    15811581    public function test_application_password_authentication() {
    1582         $user_id = self::factory()->user->create(
    1583             array(
    1584                 'user_login' => 'http_auth_login',
    1585                 'user_pass'  => 'http_auth_pass', // Shouldn't be allowed for API login.
    1586             )
    1587         );
     1582        $user_id = self::$_user->ID;
    15881583
    15891584        // Create a new app-only password.
     
    15951590
    15961591        // Fake an HTTP Auth request with the regular account password first.
    1597         $_SERVER['PHP_AUTH_USER'] = 'http_auth_login';
    1598         $_SERVER['PHP_AUTH_PW']   = 'http_auth_pass';
     1592        $_SERVER['PHP_AUTH_USER'] = self::USER_LOGIN;
     1593        $_SERVER['PHP_AUTH_PW']   = self::USER_PASS;
    15991594
    16001595        $this->assertNull(
Note: See TracChangeset for help on using the changeset viewer.