Make WordPress Core

Changeset 407 in tests for wp-testcase/test_http.php


Ignore:
Timestamp:
08/04/2011 08:38:26 PM (15 years ago)
Author:
ryan
Message:

Pinking shears

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_http.php

    r366 r407  
    3232        }
    3333
    34         function test_redirect_on_301() {       
     34        function test_redirect_on_301() {
    3535                // 5 : 5 & 301
    3636                $res = wp_remote_request($this->redirection_script . '?code=301&rt=' . 5, array('redirection' => 5) );
     
    3838        }
    3939
    40         function test_redirect_on_302() {       
     40        function test_redirect_on_302() {
    4141                // 5 : 5 & 302
    4242                $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 5, array('redirection' => 5) );
    4343                $this->assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
    4444        }
    45        
     45
    4646        function test_redirect_on_301_no_redirect() {
    4747                $this->knownWPBug(16855);
     
    5858        }
    5959
    60         function test_redirections_equal() {   
     60        function test_redirections_equal() {
    6161                // 5 - 5
    6262                $res = wp_remote_request($this->redirection_script . '?rt=' . 5, array('redirection' => 5) );
     
    9999                // 0 redirections asked for, Should return the document?
    100100                $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']) );
    102102        }
    103        
     103
    104104        function test_location_header_on_200() {
    105105                //$this->knownWPBug(16889);
    106106                // 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
    108108                // Do not redirect on non 3xx status codes
    109109                //$res = wp_remote_request( $this->redirection_script . '?200-location=true' ); // Prints PASS on initial load, FAIL if the client follows the specified redirection
    110110                //$this->assertEquals( 'PASS', $res['body']);
    111111        }
    112        
     112
    113113        function test_send_headers() {
    114114                $this->knownWPBug(11888);
     
    132132                //$this->assertTrue( isset($headers['test3']) && '' === $headers['test3'] );
    133133        }
    134        
     134
    135135        function test_file_stream() {
    136136                $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.