Changeset 50087 for branches/4.8/tests/phpunit/includes/testcase.php
- Timestamp:
- 01/30/2021 11:13:04 AM (4 years ago)
- Location:
- branches/4.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.8
- Property svn:mergeinfo changed
/trunk merged: 43511-43512,46682,46996
- Property svn:mergeinfo changed
-
branches/4.8/tests/phpunit/includes/testcase.php
r40875 r50087 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 … … 218 218 $this->markTestSkipped( 'Test does not run on Multisite' ); 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.