Changeset 50103 for branches/4.1/tests/phpunit/includes/testcase.php
- Timestamp:
- 01/30/2021 09:01:52 PM (5 years ago)
- Location:
- branches/4.1
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/includes/testcase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1
- Property svn:mergeinfo changed
/trunk merged: 38757,43511-43512,46682,46996
- Property svn:mergeinfo changed
-
branches/4.1/tests/phpunit/includes/testcase.php
r42064 r50103 99 99 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 100 100 } 101 } 102 103 /** 104 * Allow tests to be skipped if the HTTP request times out. 105 * 106 * @param array|WP_Error $response HTTP response. 107 */ 108 public function skipTestOnTimeout( $response ) { 109 if ( ! is_wp_error( $response ) ) { 110 return; 111 } 112 if ( 'connect() timed out!' === $response->get_error_message() ) { 113 $this->markTestSkipped( 'HTTP timeout' ); 114 } 115 116 if ( false !== strpos( $response->get_error_message(), 'timed out after' ) ) { 117 $this->markTestSkipped( 'HTTP timeout' ); 118 } 119 120 if ( 0 === strpos( $response->get_error_message(), 'stream_socket_client(): unable to connect to tcp://s.w.org:80' ) ) { 121 $this->markTestSkipped( 'HTTP timeout' ); 122 } 123 101 124 } 102 125
Note: See TracChangeset
for help on using the changeset viewer.