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/intermediateSize.php

    r51657 r52010  
    66 */
    77class Tests_Image_Intermediate_Size extends WP_UnitTestCase {
    8     function tear_down() {
     8    public function tear_down() {
    99        $this->remove_added_uploads();
    1010
     
    2323    }
    2424
    25     function test_make_intermediate_size_no_size() {
     25    public function test_make_intermediate_size_no_size() {
    2626        $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 0, 0, false );
    2727
     
    3232     * @requires function imagejpeg
    3333     */
    34     function test_make_intermediate_size_width() {
     34    public function test_make_intermediate_size_width() {
    3535        $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 0, false );
    3636
     
    4141     * @requires function imagejpeg
    4242     */
    43     function test_make_intermediate_size_height() {
     43    public function test_make_intermediate_size_height() {
    4444        $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 0, 75, false );
    4545
     
    5050     * @requires function imagejpeg
    5151     */
    52     function test_make_intermediate_size_successful() {
     52    public function test_make_intermediate_size_successful() {
    5353        $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 75, true );
    5454
     
    6767     * @requires function imagejpeg
    6868     */
    69     function test_image_editor_output_format_filter() {
     69    public function test_image_editor_output_format_filter() {
    7070        add_filter(
    7171            'image_editor_output_format',
     
    9393     * @requires function imagejpeg
    9494     */
    95     function test_get_intermediate_sizes_by_name() {
     95    public function test_get_intermediate_sizes_by_name() {
    9696        add_image_size( 'test-size', 330, 220, true );
    9797
     
    114114     * @requires function imagejpeg
    115115     */
    116     function test_get_intermediate_sizes_by_array_exact() {
     116    public function test_get_intermediate_sizes_by_array_exact() {
    117117        // Only one dimention match shouldn't return false positive (see: #17626).
    118118        add_image_size( 'test-size', 330, 220, true );
     
    136136     * @requires function imagejpeg
    137137     */
    138     function test_get_intermediate_sizes_by_array_nearest() {
     138    public function test_get_intermediate_sizes_by_array_nearest() {
    139139        // If an exact size is not found, it should be returned.
    140140        // If not, find nearest size that is larger (see: #17626).
     
    159159     * @requires function imagejpeg
    160160     */
    161     function test_get_intermediate_sizes_by_array_nearest_false() {
     161    public function test_get_intermediate_sizes_by_array_nearest_false() {
    162162        // If an exact size is not found, it should be returned.
    163163        // If not, find nearest size that is larger, otherwise return false (see: #17626).
     
    181181     * @requires function imagejpeg
    182182     */
    183     function test_get_intermediate_sizes_by_array_zero_height() {
     183    public function test_get_intermediate_sizes_by_array_zero_height() {
    184184        // Generate random width.
    185185        $random_w = rand( 300, 400 );
     
    210210     * @requires function imagejpeg
    211211     */
    212     function test_get_intermediate_sizes_by_array_zero_width() {
     212    public function test_get_intermediate_sizes_by_array_zero_width() {
    213213        // 202 is the smallest height that will trigger a miss for 'false-height'.
    214214        $height = 202;
Note: See TracChangeset for help on using the changeset viewer.