Make WordPress Core

Changeset 60143


Ignore:
Timestamp:
04/08/2025 01:54:41 PM (6 weeks ago)
Author:
audrasjb
Message:

REST API: Fix hardcoded table name in WP_Test_REST_Users_Controller.

This changeset fixes failing unit tests on the Hosting test suite because of the hardcoded table name in WP_Test_REST_Users_Controller::test_get_items_only_fetches_ids_for_head_requests.

Reviewed by audrasjb, spacedmonkey.
Merges [60141] to the 6.8 branch.
Props antonvlasenko, desrosj.
Fixes #56481.

Location:
branches/6.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.8

  • branches/6.8/tests/phpunit/tests/rest-api/rest-users-controller.php

    r59970 r60143  
    33013301        global $wpdb;
    33023302        $users_table = preg_quote( $wpdb->users, '/' );
    3303         $pattern     = '/SELECT SQL_CALC_FOUND_ROWS wptests_users.ID\n\s+FROM\s+' . $users_table . '/is';
     3303        $pattern     = '/^SELECT\s+SQL_CALC_FOUND_ROWS\s+' . $users_table . '\.ID\n\s+FROM\s+' . $users_table . '/is';
    33043304
    33053305        // Assert that the SQL query only fetches the id column.
Note: See TracChangeset for help on using the changeset viewer.