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/xmlrpc/wp/getComments.php

    r51331 r52010  
    77    public $post_id;
    88
    9     function test_invalid_username_password() {
     9    public function test_invalid_username_password() {
    1010        $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'username', 'password', array() ) );
    1111        $this->assertIXRError( $result );
     
    1313    }
    1414
    15     function test_incapable_user() {
     15    public function test_incapable_user() {
    1616        $this->make_user_by_role( 'contributor' );
    1717
     
    2121    }
    2222
    23     function test_capable_user() {
     23    public function test_capable_user() {
    2424        $this->post_id = self::factory()->post->create();
    2525        self::factory()->comment->create_post_comments( $this->post_id, 2 );
     
    3636    }
    3737
    38     function test_post_filter() {
     38    public function test_post_filter() {
    3939        $this->post_id = self::factory()->post->create();
    4040        self::factory()->comment->create_post_comments( $this->post_id, 2 );
     
    5959    }
    6060
    61     function test_number_filter() {
     61    public function test_number_filter() {
    6262        $this->post_id = self::factory()->post->create();
    6363        self::factory()->comment->create_post_comments( $this->post_id, 11 );
     
    9595    }
    9696
    97     function test_contributor_capabilities() {
     97    public function test_contributor_capabilities() {
    9898        $this->make_user_by_role( 'contributor' );
    9999        $author_id      = $this->make_user_by_role( 'author' );
     
    138138    }
    139139
    140     function test_author_capabilities() {
     140    public function test_author_capabilities() {
    141141        $author_id      = $this->make_user_by_role( 'author' );
    142142        $author_post_id = self::factory()->post->create(
     
    230230    }
    231231
    232     function test_editor_capabilities() {
     232    public function test_editor_capabilities() {
    233233        $author_id      = $this->make_user_by_role( 'author' );
    234234        $author_post_id = self::factory()->post->create(
Note: See TracChangeset for help on using the changeset viewer.