Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (5 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/rest-api.php

    r46586 r47122  
    317317
    318318    /**
    319      * The 'methods' arg should a comma seperated string.
    320      */
    321     public function test_route_method_comma_seperated() {
     319     * The 'methods' arg should a comma-separated string.
     320     */
     321    public function test_route_method_comma_separated() {
    322322        register_rest_route(
    323323            'test-ns',
     
    709709        $this->assertTrue( is_admin() );
    710710
    711         // Test an HTTP URL
     711        // Test an HTTP URL.
    712712        unset( $_SERVER['HTTPS'] );
    713713        $url = get_rest_url();
    714714        $this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) );
    715715
    716         // Test an HTTPS URL
     716        // Test an HTTPS URL.
    717717        $_SERVER['HTTPS'] = 'on';
    718718        $url              = get_rest_url();
    719719        $this->assertSame( 'https', parse_url( $url, PHP_URL_SCHEME ) );
    720720
    721         // Switch to an admin request on a different domain name
     721        // Switch to an admin request on a different domain name.
    722722        $_SERVER['SERVER_NAME'] = 'admin.example.org';
    723723        update_option( 'siteurl', 'http://admin.example.org' );
    724724        $this->assertNotEquals( $_SERVER['SERVER_NAME'], parse_url( home_url(), PHP_URL_HOST ) );
    725725
    726         // // Test an HTTP URL
     726        // Test an HTTP URL.
    727727        unset( $_SERVER['HTTPS'] );
    728728        $url = get_rest_url();
    729729        $this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) );
    730730
    731         // // Test an HTTPS URL
     731        // Test an HTTPS URL.
    732732        $_SERVER['HTTPS'] = 'on';
    733733        $url              = get_rest_url();
    734734        $this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) );
    735735
    736         // Reset
     736        // Reset.
    737737        update_option( 'siteurl', $_siteurl );
    738738        set_current_screen( 'front' );
     
    769769    public function jsonp_callback_provider() {
    770770        return array(
    771             // Standard names
     771            // Standard names.
    772772            array( 'Springfield', true ),
    773773            array( 'shelby.ville', true ),
     
    775775            array( 'KampKrusty1', true ),
    776776
    777             // Invalid names
     777            // Invalid names.
    778778            array( 'ogden-ville', false ),
    779779            array( 'north haverbrook', false ),
     
    794794    public function rest_date_provider() {
    795795        return array(
    796             // Valid dates with timezones
     796            // Valid dates with timezones.
    797797            array( '2017-01-16T11:30:00-05:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) + 5 * HOUR_IN_SECONDS ),
    798798            array( '2017-01-16T11:30:00-05:30', gmmktime( 11, 30, 0, 1, 16, 2017 ) + 5.5 * HOUR_IN_SECONDS ),
     
    803803            array( '2017-01-16T11:30:00Z', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),
    804804
    805             // Valid dates without timezones
     805            // Valid dates without timezones.
    806806            array( '2017-01-16T11:30:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),
    807807
    808             // Invalid dates (TODO: support parsing partial dates as ranges, see #38641)
     808            // Invalid dates (TODO: support parsing partial dates as ranges, see #38641).
    809809            array( '2017-01-16T11:30:00-5', false ),
    810810            array( '2017-01-16T11:30', false ),
     
    826826    public function rest_date_force_utc_provider() {
    827827        return array(
    828             // Valid dates with timezones
     828            // Valid dates with timezones.
    829829            array( '2017-01-16T11:30:00-05:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),
    830830            array( '2017-01-16T11:30:00-05:30', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),
     
    835835            array( '2017-01-16T11:30:00Z', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),
    836836
    837             // Valid dates without timezones
     837            // Valid dates without timezones.
    838838            array( '2017-01-16T11:30:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),
    839839
    840             // Invalid dates (TODO: support parsing partial dates as ranges, see #38641)
     840            // Invalid dates (TODO: support parsing partial dates as ranges, see #38641).
    841841            array( '2017-01-16T11:30:00-5', false ),
    842842            array( '2017-01-16T11:30', false ),
Note: See TracChangeset for help on using the changeset viewer.