[wp-trac] [WordPress Trac] #39122: REST API: Add Term Meta Unit Test Coverage

WordPress Trac noreply at wordpress.org
Sun Aug 12 21:32:20 UTC 2018


#39122: REST API: Add Term Meta Unit Test Coverage
----------------------------+------------------------------
 Reporter:  timmydcrawford  |       Owner:  kadamwhite
     Type:  enhancement     |      Status:  reopened
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  REST API        |     Version:  4.7
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------

Comment (by birgire):

 Since the ticket has been reopen, [attachment:"39122.2.diff"] contains
 some suggestions:

 - Adjustments according to the WPCS.
 - Removes duplicated array key assertion: {{{$this->assertArrayHasKey(
 'meta', $data );}}}
 - Adds {{{@ticket}}} annotations.
 - Use {{{asserSame}}} instead of {{{assertEquals}}}, as {{{null}}},
 {{{false}}} and {{{''}}} are equal under {{{assertEquals}}}.
 - Use {{{assertFalse}}} instead of      {{{assertEquals( false, ... )
 );}}}
 - Additional note: Instead of {{{$this->assertEquals( false, isset(
 $meta['test_cat_meta'] ) );}}}, one could consider
 {{{assertArrayNotHasKey}}}, but we note that it also returns {{{true}}}
 for {{{null}}} values. But I didn't change it in the patch to use
 {{{assertArrayNotHasKey}}}.

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


More information about the wp-trac mailing list