Changeset 46682 for trunk/tests/phpunit/includes/abstract-testcase.php
- Timestamp:
- 11/09/2019 03:36:19 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/abstract-testcase.php
r46612 r46682 181 181 182 182 /** 183 * Allow tests to be skipped on some automated runs 183 * Allow tests to be skipped on some automated runs. 184 184 * 185 185 * For test runs on Travis for something other than trunk/master … … 221 221 $this->markTestSkipped( 'Test does not run on Multisite' ); 222 222 } 223 } 224 225 /** 226 * Allow tests to be skipped if the HTTP request times out. 227 * 228 * @param array|WP_Error $response HTTP response. 229 */ 230 public function skipTestOnTimeout( $response ) { 231 if ( ! is_wp_error( $response ) ) { 232 return; 233 } 234 if ( 'connect() timed out!' === $response->get_error_message() ) { 235 $this->markTestSkipped( 'HTTP timeout' ); 236 } 237 238 if ( false !== strpos( $response->get_error_message(), 'timed out after' ) ) { 239 $this->markTestSkipped( 'HTTP timeout' ); 240 } 241 242 if ( 0 === strpos( $response->get_error_message(), 'stream_socket_client(): unable to connect to tcp://s.w.org:80' ) ) { 243 $this->markTestSkipped( 'HTTP timeout' ); 244 } 245 223 246 } 224 247
Note: See TracChangeset
for help on using the changeset viewer.