Make WordPress Core


Ignore:
Timestamp:
05/13/2016 04:41:45 AM (9 years ago)
Author:
rmccue
Message:

HTTP API: Replace internals with Requests library.

Requests is a library very similar to WP_HTTP, with a high level of unit test coverage, and has a common lineage and development team. It also supports parallel requests.

See #33055.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/http/functions.php

    r35734 r37428  
    2020        $headers = wp_remote_retrieve_headers( $response );
    2121
    22         $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
    2322        $this->assertEquals( 'image/jpeg', $headers['content-type'] );
    2423        $this->assertEquals( '40148', $headers['content-length'] );
     
    3736        $headers = wp_remote_head( $url );
    3837
    39         $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
    4038        $this->assertEquals( '404', wp_remote_retrieve_response_code( $headers ) );
    4139    }
     
    4846
    4947        // should return the same headers as a head request
    50         $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
    5148        $this->assertEquals( 'image/jpeg', $headers['content-type'] );
    5249        $this->assertEquals( '40148', $headers['content-length'] );
     
    6259
    6360        // should return the same headers as a head request
    64         $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
    6561        $this->assertEquals( 'image/jpeg', $headers['content-type'] );
    6662        $this->assertEquals( '40148', $headers['content-length'] );
     
    8682        $cookies  = wp_remote_retrieve_cookies( $response );
    8783
    88         $this->assertInternalType( 'array', $cookies );
    8984        $this->assertNotEmpty( $cookies );
    9085
Note: See TracChangeset for help on using the changeset viewer.