[wp-trac] [WordPress Trac] #54420: Tests: Mock REST API remote requests

WordPress Trac noreply at wordpress.org
Fri Nov 12 13:45:19 UTC 2021


#54420: Tests: Mock REST API remote requests
--------------------------------------+-----------------------------
 Reporter:  hellofromTonya            |       Owner:  hellofromTonya
     Type:  task (blessed)            |      Status:  reopened
 Priority:  normal                    |   Milestone:  6.0
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  rest-api
--------------------------------------+-----------------------------

Comment (by hellofromTonya):

 In [changeset:"52146" 52146]:
 {{{
 #!CommitTicketReference repository="" revision="52146"
 Build/Test Tools: Mock no results remote request in
 WP_REST_Block_Directory_Controller:: get_items().

 * Refactors the mock logic to a helper function for reuse in multiple
 tests.
 * Mocks the remote request in `WP_REST_Block_Directory_Controller_Test::
 test_get_items_no_results()` using the mock helper.

 Follow-up to [48242], [52137].

 Props hellofromTonya, sergeybiryukov.
 See #54420.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54420#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list