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/user/author.php

    r51568 r52010  
    3434    }
    3535
    36     function set_up() {
     36    public function set_up() {
    3737        parent::set_up();
    3838
     
    4040    }
    4141
    42     function test_get_the_author() {
     42    public function test_get_the_author() {
    4343        $author_name = get_the_author();
    4444        $user        = new WP_User( self::$author_id );
     
    4848    }
    4949
    50     function test_get_the_author_meta() {
     50    public function test_get_the_author_meta() {
    5151        $this->assertSame( 'test_author', get_the_author_meta( 'login' ) );
    5252        $this->assertSame( 'test_author', get_the_author_meta( 'user_login' ) );
     
    6969    }
    7070
    71     function test_get_the_author_meta_no_authordata() {
     71    public function test_get_the_author_meta_no_authordata() {
    7272        unset( $GLOBALS['authordata'] );
    7373        $this->assertSame( '', get_the_author_meta( 'id' ) );
     
    7676    }
    7777
    78     function test_get_the_author_posts() {
     78    public function test_get_the_author_posts() {
    7979        // Test with no global post, result should be 0 because no author is found.
    8080        $this->assertSame( 0, get_the_author_posts() );
     
    8686     * @ticket 30904
    8787     */
    88     function test_get_the_author_posts_with_custom_post_type() {
     88    public function test_get_the_author_posts_with_custom_post_type() {
    8989        register_post_type( 'wptests_pt' );
    9090
Note: See TracChangeset for help on using the changeset viewer.