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

    r51587 r52010  
    180180        $comment_id = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
    181181
    182         add_filter( 'wp_update_comment_data', array( $this, '_wp_update_comment_data_filter' ), 10, 3 );
     182        add_filter( 'wp_update_comment_data', array( $this, 'wp_update_comment_data_filter' ), 10, 3 );
    183183
    184184        $result = wp_update_comment(
     
    190190        );
    191191
    192         remove_filter( 'wp_update_comment_data', array( $this, '_wp_update_comment_data_filter' ), 10, 3 );
     192        remove_filter( 'wp_update_comment_data', array( $this, 'wp_update_comment_data_filter' ), 10, 3 );
    193193
    194194        $this->assertWPError( $result );
     
    198198     * Blocks comments from being updated by returning WP_Error.
    199199     */
    200     public function _wp_update_comment_data_filter( $data, $comment, $commentarr ) {
     200    public function wp_update_comment_data_filter( $data, $comment, $commentarr ) {
    201201        return new WP_Error( 'comment_wrong', 'wp_update_comment_data filter fails for this comment.', 500 );
    202202    }
Note: See TracChangeset for help on using the changeset viewer.