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/image/size.php

    r46586 r47122  
    99
    1010    function test_constrain_dims_zero() {
    11         // no constraint - should have no effect
     11        // No constraint - should have no effect.
    1212        $out = wp_constrain_dimensions( 640, 480, 0, 0 );
    1313        $this->assertSame( array( 640, 480 ), $out );
     
    2424
    2525    function test_constrain_dims_smaller() {
    26         // image size is smaller than the constraint - no effect
     26        // Image size is smaller than the constraint - no effect.
    2727        $out = wp_constrain_dimensions( 500, 600, 1024, 768 );
    2828        $this->assertSame( array( 500, 600 ), $out );
     
    3636
    3737    function test_constrain_dims_equal() {
    38         // image size is equal to the constraint - no effect
     38        // Image size is equal to the constraint - no effect.
    3939        $out = wp_constrain_dimensions( 1024, 768, 1024, 768 );
    4040        $this->assertSame( array( 1024, 768 ), $out );
     
    4848
    4949    function test_constrain_dims_larger() {
    50         // image size is larger than the constraint - result should be constrained
     50        // Image size is larger than the constraint - result should be constrained.
    5151        $out = wp_constrain_dimensions( 1024, 768, 500, 600 );
    5252        $this->assertSame( array( 500, 375 ), $out );
     
    5858        $this->assertSame( array( 500, 375 ), $out );
    5959
    60         // also try a portrait oriented image
     60        // Also try a portrait oriented image.
    6161        $out = wp_constrain_dimensions( 300, 800, 500, 600 );
    6262        $this->assertSame( array( 225, 600 ), $out );
     
    7070
    7171    function test_constrain_dims_boundary() {
    72         // one dimension is larger than the constraint, one smaller - result should be constrained
     72        // One dimension is larger than the constraint, one smaller - result should be constrained.
    7373        $out = wp_constrain_dimensions( 1024, 768, 500, 800 );
    7474        $this->assertSame( array( 500, 375 ), $out );
     
    7777        $this->assertSame( array( 933, 700 ), $out );
    7878
    79         // portrait
     79        // Portrait.
    8080        $out = wp_constrain_dimensions( 768, 1024, 800, 500 );
    8181        $this->assertSame( array( 375, 500 ), $out );
     
    100100     */
    101101    function test_shrink_dimensions_smaller() {
    102         // image size is smaller than the constraint - no effect
     102        // Image size is smaller than the constraint - no effect.
    103103        $out = wp_shrink_dimensions( 500, 600, 1024, 768 );
    104104        $this->assertSame( array( 500, 600 ), $out );
     
    112112     */
    113113    function test_shrink_dimensions_equal() {
    114         // image size is equal to the constraint - no effect
     114        // Image size is equal to the constraint - no effect.
    115115        $out = wp_shrink_dimensions( 500, 600, 500, 600 );
    116116        $this->assertSame( array( 500, 600 ), $out );
     
    124124     */
    125125    function test_shrink_dimensions_larger() {
    126         // image size is larger than the constraint - result should be constrained
     126        // Image size is larger than the constraint - result should be constrained.
    127127        $out = wp_shrink_dimensions( 1024, 768, 500, 600 );
    128128        $this->assertSame( array( 500, 375 ), $out );
     
    136136     */
    137137    function test_shrink_dimensions_boundary() {
    138         // one dimension is larger than the constraint, one smaller - result should be constrained
     138        // One dimension is larger than the constraint, one smaller - result should be constrained.
    139139        $out = wp_shrink_dimensions( 1024, 768, 500, 800 );
    140140        $this->assertSame( array( 500, 375 ), $out );
     
    143143        $this->assertSame( array( 933, 700 ), $out );
    144144
    145         // portrait
     145        // Portrait.
    146146        $out = wp_shrink_dimensions( 768, 1024, 800, 500 );
    147147        $this->assertSame( array( 375, 500 ), $out );
     
    160160
    161161    function test_constrain_size_for_editor_medium() {
    162         // default max width is 500, no constraint on height
     162        // Default max width is 500, no constraint on height.
    163163        global $content_width;
    164164
     
    178178        $this->assertSame( array( 64, 64 ), $out );
    179179
    180         // content_width should be ignored
     180        // $content_width should be ignored.
    181181        $content_width = 350;
    182182        $out           = image_constrain_size_for_editor( 600, 400, 'medium' );
     
    198198        $this->assertSame( array( 64, 64 ), $out );
    199199
    200         // content_width default is 500
     200        // $content_width default is 500.
    201201        $content_width = 0;
    202202
Note: See TracChangeset for help on using the changeset viewer.