[wp-trac] [WordPress Trac] #40270: Incorrect error assertions in some REST API tests

WordPress Trac noreply at wordpress.org
Mon Mar 27 15:08:04 UTC 2017


#40270: Incorrect error assertions in some REST API tests
--------------------------+------------------------------
 Reporter:  dlh           |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  REST API      |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by jnylen0):

 Good catch @dlh.

 This is the preferred way of verifying that a response is not an error:

 `$this->assertEquals( 200, $response->get_status() );`

 (or `201` as needed).

 These assertions are already present for the cases you noted, so let's
 just remove the two `assertNotInstanceOf` lines.  I don't see any other
 such lines in the REST API tests.

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


More information about the wp-trac mailing list