Changeset 50088 for branches/4.7/tests/phpunit/includes/testcase.php
- Timestamp:
- 01/30/2021 11:29:34 AM (5 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/includes/testcase.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
- Property svn:mergeinfo changed
/trunk merged: 43511-43512,46682,46996
- Property svn:mergeinfo changed
-
branches/4.7/tests/phpunit/includes/testcase.php
r41305 r50088 178 178 179 179 /** 180 * Allow tests to be skipped on some automated runs 180 * Allow tests to be skipped on some automated runs. 181 181 * 182 182 * For test runs on Travis for something other than trunk/master … … 233 233 _unregister_post_status( $post_status ); 234 234 } 235 } 236 237 /** 238 * Allow tests to be skipped if the HTTP request times out. 239 * 240 * @param array|WP_Error $response HTTP response. 241 */ 242 public function skipTestOnTimeout( $response ) { 243 if ( ! is_wp_error( $response ) ) { 244 return; 245 } 246 if ( 'connect() timed out!' === $response->get_error_message() ) { 247 $this->markTestSkipped( 'HTTP timeout' ); 248 } 249 250 if ( false !== strpos( $response->get_error_message(), 'timed out after' ) ) { 251 $this->markTestSkipped( 'HTTP timeout' ); 252 } 253 254 if ( 0 === strpos( $response->get_error_message(), 'stream_socket_client(): unable to connect to tcp://s.w.org:80' ) ) { 255 $this->markTestSkipped( 'HTTP timeout' ); 256 } 257 235 258 } 236 259
Note: See TracChangeset
for help on using the changeset viewer.