Changeset 50104 for branches/4.0/tests/phpunit/includes/testcase.php
- Timestamp:
- 01/30/2021 09:03:08 PM (6 years ago)
- Location:
- branches/4.0
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/includes/testcase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.0
- Property svn:mergeinfo changed
/trunk merged: 38757,43511-43512,46682,46996
- Property svn:mergeinfo changed
-
branches/4.0/tests/phpunit/includes/testcase.php
r47331 r50104 53 53 $this->expectDeprecated(); 54 54 add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); 55 } 56 57 /** 58 * Allow tests to be skipped if the HTTP request times out. 59 * 60 * @param array|WP_Error $response HTTP response. 61 */ 62 public function skipTestOnTimeout( $response ) { 63 if ( ! is_wp_error( $response ) ) { 64 return; 65 } 66 if ( 'connect() timed out!' === $response->get_error_message() ) { 67 $this->markTestSkipped( 'HTTP timeout' ); 68 } 69 70 if ( false !== strpos( $response->get_error_message(), 'timed out after' ) ) { 71 $this->markTestSkipped( 'HTTP timeout' ); 72 } 73 74 if ( 0 === strpos( $response->get_error_message(), 'stream_socket_client(): unable to connect to tcp://s.w.org:80' ) ) { 75 $this->markTestSkipped( 'HTTP timeout' ); 76 } 77 55 78 } 56 79
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)