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/multisite/updateBlogDetails.php

    r51860 r52010  
    1212                 * should return false.
    1313                 */
    14                 function test_update_blog_details_with_empty_args() {
     14                public function test_update_blog_details_with_empty_args() {
    1515                        $result = update_blog_details( 1, array() );
    1616                        $this->assertFalse( $result );
     
    2020                 * If the ID passed is not that of a current site, we should expect false.
    2121                 */
    22                 function test_update_blog_details_invalid_blog_id() {
     22                public function test_update_blog_details_invalid_blog_id() {
    2323                        $result = update_blog_details( 999, array( 'domain' => 'example.com' ) );
    2424                        $this->assertFalse( $result );
    2525                }
    2626
    27                 function test_update_blog_details() {
     27                public function test_update_blog_details() {
    2828                        $blog_id = self::factory()->blog->create();
    2929
     
    6767                        }
    6868
    69                         add_action( $hook, array( $this, '_action_counter_cb' ), 10 );
     69                        add_action( $hook, array( $this, 'action_counter_cb' ), 10 );
    7070
    7171                        update_blog_details( $blog_id, array( $flag => $flag_value ) );
     
    8383                        $this->assertSame( 1, $test_action_counter );
    8484
    85                         remove_action( $hook, array( $this, '_action_counter_cb' ), 10 );
     85                        remove_action( $hook, array( $this, 'action_counter_cb' ), 10 );
    8686                }
    8787
     
    102102                 * Provide a counter to determine that hooks are firing when intended.
    103103                 */
    104                 function _action_counter_cb() {
     104                public function action_counter_cb() {
    105105                        global $test_action_counter;
    106106                        $test_action_counter++;
Note: See TracChangeset for help on using the changeset viewer.