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

    r51587 r52010  
    88    protected $administrator_id;
    99
    10     function set_up() {
     10    public function set_up() {
    1111        parent::set_up();
    1212
     
    1818    }
    1919
    20     function test_invalid_username_password() {
     20    public function test_invalid_username_password() {
    2121        $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'username', 'password', 1 ) );
    2222        $this->assertIXRError( $result );
     
    2424    }
    2525
    26     function test_invalid_user() {
     26    public function test_invalid_user() {
    2727        $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', 34902348908234 ) );
    2828        $this->assertIXRError( $result );
     
    3030    }
    3131
    32     function test_incapable_user() {
     32    public function test_incapable_user() {
    3333        $this->make_user_by_role( 'subscriber' );
    3434        $editor_id = $this->make_user_by_role( 'editor' );
     
    3939    }
    4040
    41     function test_subscriber_self() {
     41    public function test_subscriber_self() {
    4242        $subscriber_id = $this->make_user_by_role( 'subscriber' );
    4343
     
    4747    }
    4848
    49     function test_valid_user() {
     49    public function test_valid_user() {
    5050        $registered_date = strtotime( '-1 day' );
    5151        $user_data       = array(
     
    102102    }
    103103
    104     function test_no_fields() {
     104    public function test_no_fields() {
    105105        $editor_id = $this->make_user_by_role( 'editor' );
    106106
     
    113113    }
    114114
    115     function test_basic_fields() {
     115    public function test_basic_fields() {
    116116        $editor_id = $this->make_user_by_role( 'editor' );
    117117
     
    127127    }
    128128
    129     function test_arbitrary_fields() {
     129    public function test_arbitrary_fields() {
    130130        $editor_id = $this->make_user_by_role( 'editor' );
    131131
Note: See TracChangeset for help on using the changeset viewer.