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/dependencies/styles.php

    r46612 r47122  
    6666        $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
    6767
    68         // No styles left to print
     68        // No styles left to print.
    6969        $this->assertEquals( '', get_echo( 'wp_print_styles' ) );
    7070    }
     
    9494     */
    9595    public function test_protocols() {
    96         // Init
     96        // Init.
    9797        global $wp_styles;
    9898        $base_url_backup     = $wp_styles->base_url;
     
    101101        $ver                 = get_bloginfo( 'version' );
    102102
    103         // Try with an HTTP reference
     103        // Try with an HTTP reference.
    104104        wp_enqueue_style( 'reset-css-http', 'http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css' );
    105105        $expected .= "<link rel='stylesheet' id='reset-css-http-css'  href='http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n";
    106106
    107         // Try with an HTTPS reference
     107        // Try with an HTTPS reference.
    108108        wp_enqueue_style( 'reset-css-https', 'http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css' );
    109109        $expected .= "<link rel='stylesheet' id='reset-css-https-css'  href='http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n";
    110110
    111         // Try with an automatic protocol reference (//)
     111        // Try with an automatic protocol reference (//).
    112112        wp_enqueue_style( 'reset-css-doubleslash', '//yui.yahooapis.com/2.8.1/build/reset/reset-min.css' );
    113113        $expected .= "<link rel='stylesheet' id='reset-css-doubleslash-css'  href='//yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n";
    114114
    115         // Try with a local resource and an automatic protocol reference (//)
     115        // Try with a local resource and an automatic protocol reference (//).
    116116        $url = '//my_plugin/style.css';
    117117        wp_enqueue_style( 'plugin-style', $url );
    118118        $expected .= "<link rel='stylesheet' id='plugin-style-css'  href='$url?ver=$ver' type='text/css' media='all' />\n";
    119119
    120         // Try with a bad protocol
     120        // Try with a bad protocol.
    121121        wp_enqueue_style( 'reset-css-ftp', 'ftp://yui.yahooapis.com/2.8.1/build/reset/reset-min.css' );
    122122        $expected .= "<link rel='stylesheet' id='reset-css-ftp-css'  href='{$wp_styles->base_url}ftp://yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n";
     
    125125        $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
    126126
    127         // No styles left to print
     127        // No styles left to print.
    128128        $this->assertEquals( '', get_echo( 'wp_print_styles' ) );
    129129
    130         // Cleanup
     130        // Cleanup.
    131131        $wp_styles->base_url = $base_url_backup;
    132132    }
     
    151151        wp_add_inline_style( 'handle', $style );
    152152
    153         // No styles left to print
     153        // No styles left to print.
    154154        $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
    155155    }
     
    166166
    167167        $wp_styles->do_concat    = true;
    168         $wp_styles->default_dirs = array( '/wp-admin/', '/wp-includes/css/' ); // Default dirs as in wp-includes/script-loader.php
     168        $wp_styles->default_dirs = array( '/wp-admin/', '/wp-includes/css/' ); // Default dirs as in wp-includes/script-loader.php.
    169169
    170170        $style  = ".thing {\n";
     
    210210        wp_add_inline_style( 'handle', $style2 );
    211211
    212         // No styles left to print
     212        // No styles left to print.
    213213        $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
    214214
Note: See TracChangeset for help on using the changeset viewer.