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

    r51869 r52010  
    99        class Tests_Multisite_GetSpaceUsed extends WP_UnitTestCase {
    1010
    11                 function test_get_space_used_switched_site() {
     11                public function test_get_space_used_switched_site() {
    1212                        $blog_id = self::factory()->blog->create();
    1313                        switch_to_blog( $blog_id );
     
    4343                 * the main site.
    4444                 */
    45                 function test_get_space_used_main_site() {
     45                public function test_get_space_used_main_site() {
    4646                        $space_used = get_space_used();
    4747
     
    7777                }
    7878
    79                 function test_get_space_used_pre_get_spaced_used_filter() {
    80                         add_filter( 'pre_get_space_used', array( $this, '_filter_space_used' ) );
     79                public function test_get_space_used_pre_get_spaced_used_filter() {
     80                        add_filter( 'pre_get_space_used', array( $this, 'filter_space_used' ) );
    8181
    8282                        $this->assertSame( 300, get_space_used() );
    8383
    84                         remove_filter( 'pre_get_space_used', array( $this, '_filter_space_used' ) );
     84                        remove_filter( 'pre_get_space_used', array( $this, 'filter_space_used' ) );
    8585                }
    8686
    87                 function _filter_space_used() {
     87                public function filter_space_used() {
    8888                        return 300;
    8989                }
Note: See TracChangeset for help on using the changeset viewer.