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/filesystem/base.php

    r51568 r52010  
    55 */
    66abstract class WP_Filesystem_UnitTestCase extends WP_UnitTestCase {
    7     function set_up() {
     7    public function set_up() {
    88        parent::set_up();
    99        add_filter( 'filesystem_method_file', array( $this, 'filter_abstraction_file' ) );
     
    1212    }
    1313
    14     function tear_down() {
     14    public function tear_down() {
    1515        global $wp_filesystem;
    1616        remove_filter( 'filesystem_method_file', array( $this, 'filter_abstraction_file' ) );
     
    2121    }
    2222
    23     function filter_fs_method( $method ) {
     23    public function filter_fs_method( $method ) {
    2424        return 'MockFS';
    2525    }
    26     function filter_abstraction_file( $file ) {
     26    public function filter_abstraction_file( $file ) {
    2727        return dirname( dirname( __DIR__ ) ) . '/includes/mock-fs.php';
    2828    }
    2929
    30     function test_is_MockFS_sane() {
     30    public function test_is_MockFS_sane() {
    3131        global $wp_filesystem;
    3232        $this->assertInstanceOf( 'WP_Filesystem_MockFS', $wp_filesystem );
Note: See TracChangeset for help on using the changeset viewer.