[wp-trac] [WordPress Trac] #41915: REST_REQUEST and parse_request in tests

WordPress Trac noreply at wordpress.org
Mon Sep 18 18:25:28 UTC 2017


#41915: REST_REQUEST and parse_request in tests
------------------------------+-----------------------------
 Reporter:  drzraf            |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:  4.8.1
 Severity:  normal            |   Keywords:
  Focuses:  rest-api          |
------------------------------+-----------------------------
 I'm testing a method (an API endpoint) making use of `REST_REQUEST`.
 I found that when the test triggers `dispatch()`, the endpoint is not
 correctly initialized:
 `REST_REQUEST` is undefined because phpunit didn't go through `wp-blog-
 header.php > WP->main() > WP->parse_request()` at which the
 `rest_api_loaded()` function is hooked to.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41915>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list