Changeset 50095 for branches/5.0/tests/phpunit/includes/testcase.php
- Timestamp:
- 01/30/2021 02:51:08 PM (4 years ago)
- Location:
- branches/5.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0
- Property svn:mergeinfo changed
/trunk merged: 46682,46996
- Property svn:mergeinfo changed
-
branches/5.0/tests/phpunit/includes/testcase.php
r41945 r50095 183 183 184 184 /** 185 * Allow tests to be skipped on some automated runs 185 * Allow tests to be skipped on some automated runs. 186 186 * 187 187 * For test runs on Travis for something other than trunk/master … … 223 223 $this->markTestSkipped( 'Test does not run on Multisite' ); 224 224 } 225 } 226 227 /** 228 * Allow tests to be skipped if the HTTP request times out. 229 * 230 * @param array|WP_Error $response HTTP response. 231 */ 232 public function skipTestOnTimeout( $response ) { 233 if ( ! is_wp_error( $response ) ) { 234 return; 235 } 236 if ( 'connect() timed out!' === $response->get_error_message() ) { 237 $this->markTestSkipped( 'HTTP timeout' ); 238 } 239 240 if ( false !== strpos( $response->get_error_message(), 'timed out after' ) ) { 241 $this->markTestSkipped( 'HTTP timeout' ); 242 } 243 244 if ( 0 === strpos( $response->get_error_message(), 'stream_socket_client(): unable to connect to tcp://s.w.org:80' ) ) { 245 $this->markTestSkipped( 'HTTP timeout' ); 246 } 247 225 248 } 226 249
Note: See TracChangeset
for help on using the changeset viewer.