Make WordPress Core

Changeset 1329 in tests for trunk/tests/http/base.php


Ignore:
Timestamp:
07/29/2013 02:09:31 AM (11 years ago)
Author:
dd32
Message:

HTTP-External Tests: Add a test for #16890

File:
1 edited

Legend:

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

    r1317 r1329  
    243243    }
    244244
     245    /**
     246     * Test HTTP Redirects with multiple Location headers specified
     247     *
     248     * @ticket 16890
     249     */
     250    function test_multiple_location_headers() {
     251        $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?multiple-location-headers=1';
     252        $res = wp_remote_head( $url, array( 'timeout' => 30 ) );
     253
     254        $this->assertInternalType( 'array', wp_remote_retrieve_header( $res, 'location' ) );
     255        $this->assertCount( 2, wp_remote_retrieve_header( $res, 'location' ) );
     256
     257        $res = wp_remote_get( $url, array( 'timeout' => 30 ) );
     258        $this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
     259
     260    }
     261
    245262}
Note: See TracChangeset for help on using the changeset viewer.