Make WordPress Core

Changeset 1317 in tests


Ignore:
Timestamp:
07/28/2013 06:12:05 AM (11 years ago)
Author:
dd32
Message:

HTTP-External tests: Add a unit test for #24182

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/http/base.php

    r1316 r1317  
    222222    }
    223223
     224    /**
     225     * Test HTTP Requests using an IP url, with a HOST header specified
     226     *
     227     * @ticket 24182
     228     */
     229    function test_ip_url_with_host_header() {
     230        $ip = gethostbyname( 'api.wordpress.org' );
     231        $url = 'http://' . $ip . '/core/tests/1.0/redirection.php?print-pass=1';
     232        $args = array(
     233            'headers' => array(
     234                'Host' => 'api.wordpress.org',
     235            ),
     236            'timeout' => 30,
     237            'redirection' => 0,
     238        );
     239
     240        $res = wp_remote_get( $url, $args );
     241        $this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
     242
     243    }
     244
    224245}
Note: See TracChangeset for help on using the changeset viewer.