Changeset 50102 for branches/4.2/tests/phpunit/includes/testcase.php
- Timestamp:
- 01/30/2021 08:46:48 PM (4 years ago)
- Location:
- branches/4.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2
- Property svn:mergeinfo changed
/trunk merged: 38757,43511-43512,46682,46996
- Property svn:mergeinfo changed
-
branches/4.2/tests/phpunit/includes/testcase.php
r40245 r50102 110 110 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 111 111 } 112 } 113 114 /** 115 * Allow tests to be skipped if the HTTP request times out. 116 * 117 * @param array|WP_Error $response HTTP response. 118 */ 119 public function skipTestOnTimeout( $response ) { 120 if ( ! is_wp_error( $response ) ) { 121 return; 122 } 123 if ( 'connect() timed out!' === $response->get_error_message() ) { 124 $this->markTestSkipped( 'HTTP timeout' ); 125 } 126 127 if ( false !== strpos( $response->get_error_message(), 'timed out after' ) ) { 128 $this->markTestSkipped( 'HTTP timeout' ); 129 } 130 131 if ( 0 === strpos( $response->get_error_message(), 'stream_socket_client(): unable to connect to tcp://s.w.org:80' ) ) { 132 $this->markTestSkipped( 'HTTP timeout' ); 133 } 134 112 135 } 113 136
Note: See TracChangeset
for help on using the changeset viewer.