Make WordPress Core


Ignore:
Timestamp:
11/09/2019 03:36:19 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Skip test_readme() if the HTTP request to secure.php.net or dev.mysql.com failed on timeout.

Move skipTestOnTimeout() to WP_UnitTestCase_Base to avoid duplication.

See #44613.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/external-http/basic.php

    r46586 r46682  
    1414
    1515        $response = wp_remote_get( 'https://secure.php.net/supported-versions.php' );
     16
     17        $this->skipTestOnTimeout( $response );
     18
    1619        if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
    1720            $this->fail( 'Could not contact PHP.net to check versions.' );
    1821        }
     22
    1923        $php = wp_remote_retrieve_body( $response );
    2024
     
    2630
    2731        $response = wp_remote_get( "https://dev.mysql.com/doc/relnotes/mysql/{$matches[1]}/en/" );
     32
     33        $this->skipTestOnTimeout( $response );
     34
    2835        if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
    2936            $this->fail( 'Could not contact dev.MySQL.com to check versions.' );
    3037        }
     38
    3139        $mysql = wp_remote_retrieve_body( $response );
    3240
Note: See TracChangeset for help on using the changeset viewer.