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

    r51587 r52010  
    88    public $siteurl;
    99
    10     function set_up() {
     10    public function set_up() {
    1111        parent::set_up();
    12         $this->_reset_options();
     12        $this->reset_options();
    1313    }
    1414
    15     function _reset_options() {
     15    private function reset_options() {
    1616        // System defaults.
    1717        update_option( 'upload_path', 'wp-content/uploads' );
     
    2020    }
    2121
    22     function test_upload_dir_default() {
     22    public function test_upload_dir_default() {
    2323        // wp_upload_dir() with default parameters.
    2424        $info   = wp_upload_dir();
     
    3131    }
    3232
    33     function test_upload_dir_relative() {
     33    public function test_upload_dir_relative() {
    3434        // wp_upload_dir() with a relative upload path that is not 'wp-content/uploads'.
    3535        update_option( 'upload_path', 'foo/bar' );
     
    4646     * @ticket 5953
    4747     */
    48     function test_upload_dir_absolute() {
     48    public function test_upload_dir_absolute() {
    4949        $path = get_temp_dir() . 'wp-unit-test';
    5050
     
    6666    }
    6767
    68     function test_upload_dir_no_yearnum() {
     68    public function test_upload_dir_no_yearnum() {
    6969        update_option( 'uploads_use_yearmonth_folders', 0 );
    7070
     
    7878    }
    7979
    80     function test_upload_path_absolute() {
     80    public function test_upload_path_absolute() {
    8181        update_option( 'upload_url_path', 'http://' . WP_TESTS_DOMAIN . '/asdf' );
    8282
     
    9292    }
    9393
    94     function test_upload_dir_empty() {
     94    public function test_upload_dir_empty() {
    9595        // Upload path setting is empty - it should default to 'wp-content/uploads'.
    9696        update_option( 'upload_path', '' );
Note: See TracChangeset for help on using the changeset viewer.