wordpress-develop/tests/phpunit/tests/rest-api
James Nylen e5d5f1058e REST API: Fix behavior of sticky posts filter when no posts are sticky.
Previously, when getting posts from the API with `sticky=true`, if there were no sticky posts set, the query would return all posts  as if the `sticky` argument was not set.  In this situation, the query should return an empty array instead.

A `sticky=true` query that should return an empty array (in the previous situation, or with `include` and no intersecting post IDs) was also broken in that it would query the post with ID 1.

Finally, this commit significantly improves test coverage for the `sticky` filter argument, including direct testing of the `WHERE` clauses generated by `WP_Query`.

Props ryelle.
Fixes #39947.


git-svn-id: https://develop.svn.wordpress.org/trunk@40122 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-25 05:02:17 +00:00
..
rest-attachments-controller.php REST API: Unify object access handling for simplicity. 2017-01-26 13:38:27 +00:00
rest-categories-controller.php REST API: Improve error messages for number relational validation. 2017-01-13 04:37:03 +00:00
rest-comments-controller.php REST API: Fix multiple issues with setting dates of posts and comments. 2017-02-21 18:17:32 +00:00
rest-controller.php REST API: Remove rest_get_post filter and get_post abstraction. 2016-11-08 13:08:49 +00:00
rest-pages-controller.php REST API: Allow unsetting of page templates in update requests. 2016-11-23 02:46:42 +00:00
rest-post-meta-fields.php REST API: improve test fixture generation, normalizing data. 2017-02-15 17:58:14 +00:00
rest-post-statuses-controller.php REST API: Introduce the Content API endpoints. 2016-10-20 02:54:12 +00:00
rest-post-types-controller.php REST API: Add the supports property to the Post Type response object. 2016-12-29 17:27:37 +00:00
rest-posts-controller.php REST API: Fix behavior of sticky posts filter when no posts are sticky. 2017-02-25 05:02:17 +00:00
rest-request-validation.php REST API: Add group and description to WP_Test_REST_Request_Validation. 2017-01-20 17:12:59 +00:00
rest-request.php REST API: Correctly parse body parameters for DELETE requests. 2017-02-23 20:09:11 +00:00
rest-revisions-controller.php REST API: Cast revision author ID to int. 2017-02-16 20:08:23 +00:00
rest-schema-sanitization.php REST API: Change “ipv4” types to “ip” to support ipv6. 2016-11-18 19:32:03 +00:00
rest-schema-setup.php REST API: Ensure that tests pass if extra endpoints are registered. 2017-02-23 15:49:44 +00:00
rest-schema-validation.php REST API: Improve error messages for number relational validation. 2017-01-13 04:37:03 +00:00
rest-server.php REST API: Deprecate the rest_enabled filter. 2016-10-26 06:27:04 +00:00
rest-settings-controller.php REST API: Register the admin_email setting in single site only. 2016-12-03 05:40:04 +00:00
rest-tags-controller.php REST API: Improve test coverage of single user endpoint for public data. 2017-01-16 16:21:00 +00:00
rest-taxonomies-controller.php REST API: Add rest_base to response objects of wp/v2/taxonomies and wp/v2/types 2016-11-10 02:20:09 +00:00
rest-test-controller.php REST API: Introduce the Content API endpoints. 2016-10-20 02:54:12 +00:00
rest-users-controller.php REST API: Do not allow access to users from a different site in multisite. 2017-02-23 22:36:54 +00:00