Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (5 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/newTerm.php

    r48937 r52010  
    1616        }
    1717
    18         function test_invalid_username_password() {
     18        public function test_invalid_username_password() {
    1919                $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'username', 'password', array() ) );
    2020                $this->assertIXRError( $result );
     
    2222        }
    2323
    24         function test_empty_taxonomy() {
     24        public function test_empty_taxonomy() {
    2525                $this->make_user_by_role( 'editor' );
    2626
     
    3131        }
    3232
    33         function test_invalid_taxonomy() {
     33        public function test_invalid_taxonomy() {
    3434                $this->make_user_by_role( 'editor' );
    3535
     
    4040        }
    4141
    42         function test_incapable_user() {
     42        public function test_incapable_user() {
    4343                $this->make_user_by_role( 'subscriber' );
    4444
     
    4949        }
    5050
    51         function test_empty_term() {
     51        public function test_empty_term() {
    5252                $this->make_user_by_role( 'editor' );
    5353
     
    6868        }
    6969
    70         function test_parent_for_nonhierarchical() {
     70        public function test_parent_for_nonhierarchical() {
    7171                $this->make_user_by_role( 'editor' );
    7272
     
    8888        }
    8989
    90         function test_parent_invalid() {
     90        public function test_parent_invalid() {
    9191                $this->make_user_by_role( 'editor' );
    9292
     
    107107        }
    108108
    109         function test_parent_not_existing() {
     109        public function test_parent_not_existing() {
    110110                $this->make_user_by_role( 'editor' );
    111111
     
    128128
    129129
    130         function test_add_term() {
    131                 $this->make_user_by_role( 'editor' );
    132 
    133                 $result = $this->myxmlrpcserver->wp_newTerm(
    134                         array(
    135                                 1,
    136                                 'editor',
    137                                 'editor',
    138                                 array(
    139                                         'taxonomy' => 'category',
    140                                         'name'     => 'test',
    141                                 ),
    142                         )
    143                 );
    144                 $this->assertNotIXRError( $result );
    145                 $this->assertStringMatchesFormat( '%d', $result );
    146         }
    147 
    148         function test_add_term_with_parent() {
     130        public function test_add_term() {
     131                $this->make_user_by_role( 'editor' );
     132
     133                $result = $this->myxmlrpcserver->wp_newTerm(
     134                        array(
     135                                1,
     136                                'editor',
     137                                'editor',
     138                                array(
     139                                        'taxonomy' => 'category',
     140                                        'name'     => 'test',
     141                                ),
     142                        )
     143                );
     144                $this->assertNotIXRError( $result );
     145                $this->assertStringMatchesFormat( '%d', $result );
     146        }
     147
     148        public function test_add_term_with_parent() {
    149149                $this->make_user_by_role( 'editor' );
    150150
     
    165165        }
    166166
    167         function test_add_term_with_all() {
     167        public function test_add_term_with_all() {
    168168                $this->make_user_by_role( 'editor' );
    169169
Note: See TracChangeset for help on using the changeset viewer.