Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (3 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/dimensions.php

    r48937 r52010  
    77 */
    88class Tests_Image_Dimensions extends WP_UnitTestCase {
    9     function test_400x400_no_crop() {
     9    public function test_400x400_no_crop() {
    1010        // Landscape: resize 640x480 to fit 400x400: 400x300.
    1111        $out = image_resize_dimensions( 640, 480, 400, 400, false );
     
    1919    }
    2020
    21     function test_400x0_no_crop() {
     21    public function test_400x0_no_crop() {
    2222        // Landscape: resize 640x480 to fit 400w: 400x300.
    2323        $out = image_resize_dimensions( 640, 480, 400, 0, false );
     
    3131    }
    3232
    33     function test_0x400_no_crop() {
     33    public function test_0x400_no_crop() {
    3434        // Landscape: resize 640x480 to fit 400h: 533x400.
    3535        $out = image_resize_dimensions( 640, 480, 0, 400, false );
     
    4343    }
    4444
    45     function test_800x800_no_crop() {
     45    public function test_800x800_no_crop() {
    4646        // Landscape: resize 640x480 to fit 800x800.
    4747        $out = image_resize_dimensions( 640, 480, 800, 800, false );
     
    5555    }
    5656
    57     function test_800x0_no_crop() {
     57    public function test_800x0_no_crop() {
    5858        // Landscape: resize 640x480 to fit 800w.
    5959        $out = image_resize_dimensions( 640, 480, 800, 0, false );
     
    6767    }
    6868
    69     function test_0x800_no_crop() {
     69    public function test_0x800_no_crop() {
    7070        // Landscape: resize 640x480 to fit 800h.
    7171        $out = image_resize_dimensions( 640, 480, 0, 800, false );
     
    8181    // Cropped versions.
    8282
    83     function test_400x400_crop() {
     83    public function test_400x400_crop() {
    8484        // Landscape: crop 640x480 to fit 400x400: 400x400 taken from a 480x480 crop at (80. 0).
    8585        $out = image_resize_dimensions( 640, 480, 400, 400, true );
     
    9393    }
    9494
    95     function test_400x0_crop() {
     95    public function test_400x0_crop() {
    9696        // Landscape: resize 640x480 to fit 400w: 400x300.
    9797        $out = image_resize_dimensions( 640, 480, 400, 0, true );
     
    105105    }
    106106
    107     function test_0x400_crop() {
     107    public function test_0x400_crop() {
    108108        // Landscape: resize 640x480 to fit 400h: 533x400.
    109109        $out = image_resize_dimensions( 640, 480, 0, 400, true );
     
    117117    }
    118118
    119     function test_400x500_crop() {
     119    public function test_400x500_crop() {
    120120        // Landscape: crop 640x480 to fit 400x500: 400x400 taken from a 480x480 crop at (80. 0).
    121121        $out = image_resize_dimensions( 640, 480, 400, 500, true );
     
    129129    }
    130130
    131     function test_640x480() {
     131    public function test_640x480() {
    132132        // Crop 640x480 to fit 640x480 (no change).
    133133        $out = image_resize_dimensions( 640, 480, 640, 480, true );
     
    157157     * @ticket 19393
    158158     */
    159     function test_crop_anchors() {
     159    public function test_crop_anchors() {
    160160        // Landscape: crop 640x480 to fit 400x500: 400x400 taken from a 480x480 crop.
    161161        // src_x = 0 (left), src_y = 0 (top).
Note: See TracChangeset for help on using the changeset viewer.