[wp-trac] [WordPress Trac] #61148: Standardise assertions for remote HTTP tests

WordPress Trac noreply at wordpress.org
Sat May 4 17:00:05 UTC 2024


#61148: Standardise assertions for remote HTTP tests
------------------------------+--------------------
 Reporter:  johnbillion       |      Owner:  (none)
     Type:  task (blessed)    |     Status:  new
 Priority:  normal            |  Milestone:  6.6
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+--------------------
 The order of assertions for remote HTTP request tests aren't entirely
 consistent, which can be a problem when an HTTP request fails and you see
 a test-specific assertion failure instead of information about why the
 request failed.

 For every HTTP request test where the request is expected to succeed, the
 order should be:

 1. `skipTestOnTimeout()` so timeouts don't cause the test to fail
 2. `assertNotWPError()` so if the request results in an error then the
 full `WP_Error` message gets output
 3. HTTP status code assertions, if necessary
 4. All other assertions

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


More information about the wp-trac mailing list