Make WordPress Core


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

    r51587 r52010  
    3131    }
    3232
    33     function test_invalid_username_password() {
     33    public function test_invalid_username_password() {
    3434        $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'username', 'password' ) );
    3535        $this->assertIXRError( $result );
     
    3737    }
    3838
    39     function test_incapable_user() {
     39    public function test_incapable_user() {
    4040        $this->make_user_by_role( 'contributor' );
    4141
     
    4545    }
    4646
    47     function test_capable_user() {
     47    public function test_capable_user() {
    4848        $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'administrator', 'administrator' ) );
    4949        $this->assertNotIXRError( $results );
     
    5555    }
    5656
    57     function remove_editor_edit_page_cap( $caps, $cap, $user_id, $args ) {
     57    public function remove_editor_edit_page_cap( $caps, $cap, $user_id, $args ) {
    5858        if ( in_array( $cap, array( 'edit_page', 'edit_others_pages' ), true ) ) {
    5959            if ( $user_id === self::$editor_id && $args[0] === self::$post_id ) {
     
    6868     * @ticket 20629
    6969     */
    70     function test_semi_capable_user() {
     70    public function test_semi_capable_user() {
    7171        add_filter( 'map_meta_cap', array( $this, 'remove_editor_edit_page_cap' ), 10, 4 );
    7272
Note: See TracChangeset for help on using the changeset viewer.