Make WordPress Core


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

    r51568 r52010  
    2121    }
    2222
    23     function test_resize_jpg() {
     23    public function test_resize_jpg() {
    2424        $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.jpg', 25, 25 );
    2525
     
    3333    }
    3434
    35     function test_resize_png() {
     35    public function test_resize_png() {
    3636        $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.png', 25, 25 );
    3737
     
    4949    }
    5050
    51     function test_resize_gif() {
     51    public function test_resize_gif() {
    5252        $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.gif', 25, 25 );
    5353
     
    6565    }
    6666
    67     function test_resize_webp() {
     67    public function test_resize_webp() {
    6868        $file   = DIR_TESTDATA . '/images/test-image.webp';
    6969        $editor = wp_get_image_editor( $file );
     
    8383    }
    8484
    85     function test_resize_larger() {
     85    public function test_resize_larger() {
    8686        // image_resize() should refuse to make an image larger.
    8787        $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.jpg', 100, 100 );
     
    9191    }
    9292
    93     function test_resize_thumb_128x96() {
     93    public function test_resize_thumb_128x96() {
    9494        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 96 );
    9595
     
    103103    }
    104104
    105     function test_resize_thumb_128x0() {
     105    public function test_resize_thumb_128x0() {
    106106        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 0 );
    107107
     
    115115    }
    116116
    117     function test_resize_thumb_0x96() {
     117    public function test_resize_thumb_0x96() {
    118118        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 0, 96 );
    119119
     
    127127    }
    128128
    129     function test_resize_thumb_150x150_crop() {
     129    public function test_resize_thumb_150x150_crop() {
    130130        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 150, true );
    131131
     
    139139    }
    140140
    141     function test_resize_thumb_150x100_crop() {
     141    public function test_resize_thumb_150x100_crop() {
    142142        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 100, true );
    143143
     
    151151    }
    152152
    153     function test_resize_thumb_50x150_crop() {
     153    public function test_resize_thumb_50x150_crop() {
    154154        $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 50, 150, true );
    155155
Note: See TracChangeset for help on using the changeset viewer.