Skip to content

Commit bb55de7

Browse files
committed
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`. Props antonvlasenko, desrosj. Fixes #56481. git-svn-id: https://develop.svn.wordpress.org/trunk@60141 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 8cd8594 commit bb55de7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/phpunit/tests/rest-api/rest-users-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3300,7 +3300,7 @@ public function test_get_items_only_fetches_ids_for_head_requests( $method ) {
33003300

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.
33063306
$this->assertMatchesRegularExpression( $pattern, $query->request, 'The SQL query does not match the expected string.' );

0 commit comments

Comments
 (0)