Changeset 1231 in tests
- Timestamp:
- 03/04/2013 06:19:32 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/WPHTTP-testcase-redirection-script.php
r370 r1231 24 24 exit; 25 25 } 26 if ( isset($_GET['20 0-location']) ) {27 header("HTTP/1.1 20 0OK");26 if ( isset($_GET['201-location']) ) { 27 header("HTTP/1.1 201 OK"); 28 28 if ( isset($_GET['fail']) ) { 29 29 echo "FAIL"; 30 30 } else { 31 header("Location: $url?20 0-location&fail=true", true, 200);31 header("Location: $url?201-location&fail=true", true, 201); 32 32 echo "PASS"; 33 33 } -
trunk/tests/http/base.php
r1205 r1231 132 132 * 133 133 * @ticket 16889 134 *135 * Is this valid? Streams, cURL and therefore PHP Extension (ie. all PHP Internal) follow redirects136 * on all status codes, currently all of WP_HTTP follows this template.137 134 */ 138 function test_location_header_on_20 0() {135 function test_location_header_on_201() { 139 136 // Prints PASS on initial load, FAIL if the client follows the specified redirection 140 $res = wp_remote_request( $this->redirection_script . '?20 0-location=true' );137 $res = wp_remote_request( $this->redirection_script . '?201-location=true' ); 141 138 $this->assertFalse( is_wp_error( $res ) ); 142 139 $this->assertEquals( 'PASS', $res['body']);
Note: See TracChangeset
for help on using the changeset viewer.