[wp-trac] [WordPress Trac] #48785: REST API: WP_REST_Controller::get_public_item_schema() assumes that the schema has properties.

WordPress Trac noreply at wordpress.org
Thu Feb 20 08:00:47 UTC 2020


#48785: REST API: WP_REST_Controller::get_public_item_schema() assumes that the
schema has properties.
-------------------------------------------------+-------------------------
 Reporter:  pento                                |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.4
Component:  REST API                             |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:
  tests commit                                   |
-------------------------------------------------+-------------------------

Comment (by birgire):

 The restapi group test on [attachment:"48785.4.diff"] seems to run
 successfully on my install.

 In [attachment:"48785.4.diff"] I noticed the:

 {{{
 assertTrue( array_key_exists( ... ) )
 assertFalse( array_key_exists(  ... ) )
 }}}

 I think alternatively one could use:

 {{{
 assertArrayHasKey
 assertArrayNotHasKey
 }}}

 I don't think we need to use {{{__()}}} in test method (no locale
 assertions).

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


More information about the wp-trac mailing list