Changeset 1329 in tests
- Timestamp:
- 07/29/2013 02:09:31 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/WPHTTP-testcase-redirection-script.php
r1318 r1329 84 84 } 85 85 86 if ( isset( $_GET['multiple-location-headers'] ) ) { 87 if ( ! isset( $_GET['redirected'] ) ) { 88 header( "Location: $url?multiple-location-headers=1&redirected=one", false ); 89 header( "Location: $url?multiple-location-headers=1&redirected=two", false ); 90 exit; 91 } 92 if ( 'two' != $_GET['redirected'] ) 93 echo 'FAIL'; 94 else 95 echo 'PASS'; 96 exit; 97 } 98 86 99 $rt = isset($_GET['rt']) ? $_GET['rt'] : 5; 87 100 $r = isset($_GET['r']) ? $_GET['r'] : 0; -
trunk/tests/http/base.php
r1317 r1329 243 243 } 244 244 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 245 262 }
Note: See TracChangeset
for help on using the changeset viewer.