Changeset 407 in tests for wp-testcase/test_http.php
- Timestamp:
- 08/04/2011 08:38:26 PM (15 years ago)
- File:
-
- 1 edited
-
wp-testcase/test_http.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test_http.php
r366 r407 32 32 } 33 33 34 function test_redirect_on_301() { 34 function test_redirect_on_301() { 35 35 // 5 : 5 & 301 36 36 $res = wp_remote_request($this->redirection_script . '?code=301&rt=' . 5, array('redirection' => 5) ); … … 38 38 } 39 39 40 function test_redirect_on_302() { 40 function test_redirect_on_302() { 41 41 // 5 : 5 & 302 42 42 $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 5, array('redirection' => 5) ); 43 43 $this->assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) ); 44 44 } 45 45 46 46 function test_redirect_on_301_no_redirect() { 47 47 $this->knownWPBug(16855); … … 58 58 } 59 59 60 function test_redirections_equal() { 60 function test_redirections_equal() { 61 61 // 5 - 5 62 62 $res = wp_remote_request($this->redirection_script . '?rt=' . 5, array('redirection' => 5) ); … … 99 99 // 0 redirections asked for, Should return the document? 100 100 $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 5, array('redirection' => 0) ); 101 $this->assertEquals( 302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) ); 101 $this->assertEquals( 302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) ); 102 102 } 103 103 104 104 function test_location_header_on_200() { 105 105 //$this->knownWPBug(16889); 106 106 // Is this valid? Streams, cURL and therefor, PHP Extension (ie. all PHP Internal) follow redirects on all status codes, currently all of WP_HTTP follows this template. 107 107 108 108 // Do not redirect on non 3xx status codes 109 109 //$res = wp_remote_request( $this->redirection_script . '?200-location=true' ); // Prints PASS on initial load, FAIL if the client follows the specified redirection 110 110 //$this->assertEquals( 'PASS', $res['body']); 111 111 } 112 112 113 113 function test_send_headers() { 114 114 $this->knownWPBug(11888); … … 132 132 //$this->assertTrue( isset($headers['test3']) && '' === $headers['test3'] ); 133 133 } 134 134 135 135 function test_file_stream() { 136 136 $url = 'http://unit-tests.svn.wordpress.org/wp-testdata/images/2004-07-22-DSC_0007.jpg'; // we'll test against a file in the unit test data
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)