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

    r51568 r52010  
    4646    }
    4747
    48     function test_is_image_positive() {
     48    public function test_is_image_positive() {
    4949        // These are all image files recognized by PHP.
    5050        $files = array(
     
    7676    }
    7777
    78     function test_is_image_negative() {
     78    public function test_is_image_negative() {
    7979        // These are actually image files but aren't recognized or usable by PHP.
    8080        $files = array(
     
    8989    }
    9090
    91     function test_is_displayable_image_positive() {
     91    public function test_is_displayable_image_positive() {
    9292        // These are all usable in typical web browsers.
    9393        $files = array(
     
    123123    }
    124124
    125     function test_is_displayable_image_negative() {
     125    public function test_is_displayable_image_negative() {
    126126        // These are image files but aren't suitable for web pages because of compatibility or size issues.
    127127        $files = array(
     
    148148     * @ticket 50833
    149149     */
    150     function test_is_gd_image_invalid_types() {
     150    public function test_is_gd_image_invalid_types() {
    151151        $this->assertFalse( is_gd_image( new stdClass() ) );
    152152        $this->assertFalse( is_gd_image( array() ) );
     
    162162     * @requires extension gd
    163163     */
    164     function test_is_gd_image_valid_types() {
     164    public function test_is_gd_image_valid_types() {
    165165        $this->assertTrue( is_gd_image( imagecreate( 5, 5 ) ) );
    166166    }
     
    427427    }
    428428
    429     function mock_image_editor( $editors ) {
     429    public function mock_image_editor( $editors ) {
    430430        return array( 'WP_Image_Editor_Mock' );
    431431    }
     
    639639    }
    640640
    641     function filter_fallback_intermediate_image_sizes( $fallback_sizes, $metadata ) {
     641    public function filter_fallback_intermediate_image_sizes( $fallback_sizes, $metadata ) {
    642642        // Add the 'test-size' to the list of fallback sizes.
    643643        $fallback_sizes[] = 'test-size';
Note: See TracChangeset for help on using the changeset viewer.