diff options
author | Jb Audras <audrasjb@git.wordpress.org> | 2025-04-08 13:02:51 +0000 |
---|---|---|
committer | Jb Audras <audrasjb@git.wordpress.org> | 2025-04-08 13:02:51 +0000 |
commit | bb55de729115761d6ef9054dd38850cf51d7a4a5 (patch) | |
tree | c4857f4915372ba64da1c4a610f445651290dca7 | |
parent | 8cd8594f439bc11e8d490166caa8b35384c18182 (diff) | |
download | wordpress-bb55de729115761d6ef9054dd38850cf51d7a4a5.tar.gz wordpress-bb55de729115761d6ef9054dd38850cf51d7a4a5.zip |
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
-rw-r--r-- | tests/phpunit/tests/rest-api/rest-users-controller.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php index 5542c12d7d..2f4a2f4982 100644 --- a/tests/phpunit/tests/rest-api/rest-users-controller.php +++ b/tests/phpunit/tests/rest-api/rest-users-controller.php @@ -3300,7 +3300,7 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { global $wpdb; $users_table = preg_quote( $wpdb->users, '/' ); - $pattern = '/SELECT SQL_CALC_FOUND_ROWS wptests_users.ID\n\s+FROM\s+' . $users_table . '/is'; + $pattern = '/^SELECT\s+SQL_CALC_FOUND_ROWS\s+' . $users_table . '\.ID\n\s+FROM\s+' . $users_table . '/is'; // Assert that the SQL query only fetches the id column. $this->assertMatchesRegularExpression( $pattern, $query->request, 'The SQL query does not match the expected string.' ); |