Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

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

    r46682 r47122  
    1616
    1717    function test_head_request() {
    18         // this url give a direct 200 response
     18        // This URL gives a direct 200 response.
    1919        $url      = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
    2020        $response = wp_remote_head( $url );
     
    3232
    3333    function test_head_redirect() {
    34         // this url will 301 redirect
     34        // This URL will 301 redirect.
    3535        $url      = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';
    3636        $response = wp_remote_head( $url );
     
    5959        $this->assertInternalType( 'array', $response );
    6060
    61         // should return the same headers as a head request
     61        // Should return the same headers as a HEAD request.
    6262        $this->assertEquals( 'image/jpeg', $headers['content-type'] );
    6363        $this->assertEquals( '40148', $headers['content-length'] );
     
    6666
    6767    function test_get_redirect() {
    68         // this will redirect to asdftestblog1.files.wordpress.com
     68        // This will redirect to asdftestblog1.files.wordpress.com.
    6969        $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';
    7070
     
    7575        $headers = wp_remote_retrieve_headers( $response );
    7676
    77         // should return the same headers as a head request
     77        // Should return the same headers as a HEAD request.
    7878        $this->assertEquals( 'image/jpeg', $headers['content-type'] );
    7979        $this->assertEquals( '40148', $headers['content-length'] );
     
    8282
    8383    function test_get_redirect_limit_exceeded() {
    84         // this will redirect to asdftestblog1.files.wordpress.com
     84        // This will redirect to asdftestblog1.files.wordpress.com.
    8585        $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';
    8686
    87         // pretend we've already redirected 5 times
     87        // Pretend we've already redirected 5 times.
    8888        $response = wp_remote_get( $url, array( 'redirection' => -1 ) );
    8989
     
    184184     */
    185185    function test_get_cookie_host_only() {
    186         // emulate WP_Http::request() internals
     186        // Emulate WP_Http::request() internals.
    187187        $requests_response = new Requests_Response();
    188188
     
    195195        $response = $http_response->to_array();
    196196
    197         // check the host_only flag in the resulting WP_Http_Cookie
     197        // Check the host_only flag in the resulting WP_Http_Cookie.
    198198        $cookie = wp_remote_retrieve_cookie( $response, 'test' );
    199199        $this->assertEquals( $cookie->domain, 'wordpress.org' );
    200200        $this->assertFalse( $cookie->host_only, 'host-only flag not set' );
    201201
    202         // regurgitate (Requests_Cookie -> WP_Http_Cookie -> Requests_Cookie)
     202        // Regurgitate (Requests_Cookie -> WP_Http_Cookie -> Requests_Cookie).
    203203        $cookies = WP_Http::normalize_cookies( wp_remote_retrieve_cookies( $response ) );
    204204        $this->assertFalse( $cookies['test']->flags['host-only'], 'host-only flag data lost' );
Note: See TracChangeset for help on using the changeset viewer.