Make WordPress Core


Ignore:
Timestamp:
12/19/2019 03:43:33 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: In test_readme(), if the HTTP request to secure.php.net or dev.mysql.com failed, include response code in the error message.

See #40533, #44613.

File:
1 edited

Legend:

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

    r46682 r46996  
    1717        $this->skipTestOnTimeout( $response );
    1818
    19         if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
    20             $this->fail( 'Could not contact PHP.net to check versions.' );
     19        $response_code = wp_remote_retrieve_response_code( $response );
     20        if ( 200 !== $response_code ) {
     21            $this->fail( sprintf( 'Could not contact PHP.net to check versions. Response code: %s', $response_code ) );
    2122        }
    2223
     
    3334        $this->skipTestOnTimeout( $response );
    3435
    35         if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
    36             $this->fail( 'Could not contact dev.MySQL.com to check versions.' );
     36        $response_code = wp_remote_retrieve_response_code( $response );
     37        if ( 200 !== $response_code ) {
     38            $this->fail( sprintf( 'Could not contact dev.MySQL.com to check versions. Response code: %s', $response_code ) );
    3739        }
    3840
Note: See TracChangeset for help on using the changeset viewer.