Changeset 50089 for branches/4.6/tests/phpunit/includes/testcase.php
- Timestamp:
- 01/30/2021 11:45:38 AM (4 years ago)
- Location:
- branches/4.6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6
- Property svn:mergeinfo changed
/trunk merged: 38757,43511-43512,46682,46996
- Property svn:mergeinfo changed
-
branches/4.6/tests/phpunit/includes/testcase.php
r40249 r50089 163 163 164 164 /** 165 * Allow tests to be skipped on some automated runs 165 * Allow tests to be skipped on some automated runs. 166 166 * 167 167 * For test runs on Travis for something other than trunk/master … … 218 218 _unregister_post_status( $post_status ); 219 219 } 220 } 221 222 /** 223 * Allow tests to be skipped if the HTTP request times out. 224 * 225 * @param array|WP_Error $response HTTP response. 226 */ 227 public function skipTestOnTimeout( $response ) { 228 if ( ! is_wp_error( $response ) ) { 229 return; 230 } 231 if ( 'connect() timed out!' === $response->get_error_message() ) { 232 $this->markTestSkipped( 'HTTP timeout' ); 233 } 234 235 if ( false !== strpos( $response->get_error_message(), 'timed out after' ) ) { 236 $this->markTestSkipped( 'HTTP timeout' ); 237 } 238 239 if ( 0 === strpos( $response->get_error_message(), 'stream_socket_client(): unable to connect to tcp://s.w.org:80' ) ) { 240 $this->markTestSkipped( 'HTTP timeout' ); 241 } 242 220 243 } 221 244
Note: See TracChangeset
for help on using the changeset viewer.