Changeset 50091 for branches/4.4/tests/phpunit/includes/testcase.php
- Timestamp:
- 01/30/2021 12:08:49 PM (4 years ago)
- Location:
- branches/4.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
- Property svn:mergeinfo changed
/trunk merged: 38757,43511-43512,46682,46996
- Property svn:mergeinfo changed
-
branches/4.4/tests/phpunit/includes/testcase.php
r40243 r50091 150 150 151 151 /** 152 * Allow tests to be skipped on some automated runs 152 * Allow tests to be skipped on some automated runs. 153 153 * 154 154 * For test runs on Travis for something other than trunk/master … … 205 205 _unregister_post_status( $post_status ); 206 206 } 207 } 208 209 /** 210 * Allow tests to be skipped if the HTTP request times out. 211 * 212 * @param array|WP_Error $response HTTP response. 213 */ 214 public function skipTestOnTimeout( $response ) { 215 if ( ! is_wp_error( $response ) ) { 216 return; 217 } 218 if ( 'connect() timed out!' === $response->get_error_message() ) { 219 $this->markTestSkipped( 'HTTP timeout' ); 220 } 221 222 if ( false !== strpos( $response->get_error_message(), 'timed out after' ) ) { 223 $this->markTestSkipped( 'HTTP timeout' ); 224 } 225 226 if ( 0 === strpos( $response->get_error_message(), 'stream_socket_client(): unable to connect to tcp://s.w.org:80' ) ) { 227 $this->markTestSkipped( 'HTTP timeout' ); 228 } 229 207 230 } 208 231
Note: See TracChangeset
for help on using the changeset viewer.