Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (5 years ago)
Author:
hellofromTonya
Message:

Coding Standards: Add visibility to methods in tests/phpunit/tests/.

Adds a public visibility to test fixtures, tests, data providers, and callbacks methods.

Adds a private visibility to helper methods within test classes.

Renames callbacks and helpers that previously started with a _ prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit.

Props costdev, jrf, hellofromTonya.
Fixes #54177.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/size.php

    r47122 r52010  
    88class Tests_Image_Size extends WP_UnitTestCase {
    99
    10         function test_constrain_dims_zero() {
     10        public function test_constrain_dims_zero() {
    1111                // No constraint - should have no effect.
    1212                $out = wp_constrain_dimensions( 640, 480, 0, 0 );
     
    2323        }
    2424
    25         function test_constrain_dims_smaller() {
     25        public function test_constrain_dims_smaller() {
    2626                // Image size is smaller than the constraint - no effect.
    2727                $out = wp_constrain_dimensions( 500, 600, 1024, 768 );
     
    3535        }
    3636
    37         function test_constrain_dims_equal() {
     37        public function test_constrain_dims_equal() {
    3838                // Image size is equal to the constraint - no effect.
    3939                $out = wp_constrain_dimensions( 1024, 768, 1024, 768 );
     
    4747        }
    4848
    49         function test_constrain_dims_larger() {
     49        public function test_constrain_dims_larger() {
    5050                // Image size is larger than the constraint - result should be constrained.
    5151                $out = wp_constrain_dimensions( 1024, 768, 500, 600 );
     
    6969        }
    7070
    71         function test_constrain_dims_boundary() {
     71        public function test_constrain_dims_boundary() {
    7272                // One dimension is larger than the constraint, one smaller - result should be constrained.
    7373                $out = wp_constrain_dimensions( 1024, 768, 500, 800 );
     
    8888         * @expectedDeprecated wp_shrink_dimensions
    8989         */
    90         function test_shrink_dimensions_default() {
     90        public function test_shrink_dimensions_default() {
    9191                $out = wp_shrink_dimensions( 640, 480 );
    9292                $this->assertSame( array( 128, 96 ), $out );
     
    9999         * @expectedDeprecated wp_shrink_dimensions
    100100         */
    101         function test_shrink_dimensions_smaller() {
     101        public function test_shrink_dimensions_smaller() {
    102102                // Image size is smaller than the constraint - no effect.
    103103                $out = wp_shrink_dimensions( 500, 600, 1024, 768 );
     
    111111         * @expectedDeprecated wp_shrink_dimensions
    112112         */
    113         function test_shrink_dimensions_equal() {
     113        public function test_shrink_dimensions_equal() {
    114114                // Image size is equal to the constraint - no effect.
    115115                $out = wp_shrink_dimensions( 500, 600, 500, 600 );
     
    123123         * @expectedDeprecated wp_shrink_dimensions
    124124         */
    125         function test_shrink_dimensions_larger() {
     125        public function test_shrink_dimensions_larger() {
    126126                // Image size is larger than the constraint - result should be constrained.
    127127                $out = wp_shrink_dimensions( 1024, 768, 500, 600 );
     
    135135         * @expectedDeprecated wp_shrink_dimensions
    136136         */
    137         function test_shrink_dimensions_boundary() {
     137        public function test_shrink_dimensions_boundary() {
    138138                // One dimension is larger than the constraint, one smaller - result should be constrained.
    139139                $out = wp_shrink_dimensions( 1024, 768, 500, 800 );
     
    151151        }
    152152
    153         function test_constrain_size_for_editor_thumb() {
     153        public function test_constrain_size_for_editor_thumb() {
    154154                $out = image_constrain_size_for_editor( 600, 400, 'thumb' );
    155155                $this->assertSame( array( 150, 100 ), $out );
     
    159159        }
    160160
    161         function test_constrain_size_for_editor_medium() {
     161        public function test_constrain_size_for_editor_medium() {
    162162                // Default max width is 500, no constraint on height.
    163163                global $content_width;
     
    186186        }
    187187
    188         function test_constrain_size_for_editor_full() {
     188        public function test_constrain_size_for_editor_full() {
    189189                global $content_width;
    190190
Note: See TracChangeset for help on using the changeset viewer.