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

    r51968 r52010  
    66class Tests_XMLRPC_wp_getRevisions extends WP_XMLRPC_UnitTestCase {
    77
    8     function test_invalid_username_password() {
     8    public function test_invalid_username_password() {
    99        $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'username', 'password', 0 ) );
    1010        $this->assertIXRError( $result );
     
    1212    }
    1313
    14     function test_incapable_user() {
     14    public function test_incapable_user() {
    1515        $this->make_user_by_role( 'subscriber' );
    1616
     
    2222    }
    2323
    24     function test_capable_user() {
     24    public function test_capable_user() {
    2525        $this->make_user_by_role( 'editor' );
    2626
     
    3030    }
    3131
    32     function test_revision_count() {
     32    public function test_revision_count() {
    3333        $this->make_user_by_role( 'editor' );
    3434
     
    6060     * @ticket 22687
    6161     */
    62     function test_revision_count_for_auto_draft_post_creation() {
    63         if ( PHP_VERSION_ID >= 80100 ) {
    64             /*
    65              * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in
    66              * via hooked in filter functions until a more structural solution to the
    67              * "missing input validation" conundrum has been architected and implemented.
    68              */
    69             $this->expectDeprecation();
    70             $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' );
    71         }
    72 
     62    public function test_revision_count_for_auto_draft_post_creation() {
    7363        $this->make_user_by_role( 'editor' );
    7464
Note: See TracChangeset for help on using the changeset viewer.