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

    r51818 r52010  
    66class Tests_Option_Option extends WP_UnitTestCase {
    77
    8         function __return_foo() {
     8        public function __return_foo() {
    99                return 'foo';
    1010        }
    1111
    12         function test_the_basics() {
     12        public function test_the_basics() {
    1313                $key    = 'key1';
    1414                $key2   = 'key2';
    … …  
    3535        }
    3636
    37         function test_default_filter() {
     37        public function test_default_filter() {
    3838                $value = 'value';
    3939
    … …  
    7272        }
    7373
    74         function test_serialized_data() {
     74        public function test_serialized_data() {
    7575                $key   = __FUNCTION__;
    7676                $value = array(
    … …  
    212212         * @ticket 23289
    213213         */
    214         function test_special_option_name_alloption() {
     214        public function test_special_option_name_alloption() {
    215215                $this->expectException( 'WPDieException' );
    216216                delete_option( 'alloptions' );
    … …  
    220220         * @ticket 23289
    221221         */
    222         function test_special_option_name_notoptions() {
     222        public function test_special_option_name_notoptions() {
    223223                $this->expectException( 'WPDieException' );
    224224                delete_option( 'notoptions' );
    225225        }
    226226
    227         function data_option_autoloading() {
     227        public function data_option_autoloading() {
    228228                return array(
    229229                        array( 'autoload_yes', 'yes', 'yes' ),
    … …  
    242242         * @dataProvider data_option_autoloading
    243243         */
    244         function test_option_autoloading( $name, $autoload_value, $expected ) {
     244        public function test_option_autoloading( $name, $autoload_value, $expected ) {
    245245                global $wpdb;
    246246                $added = add_option( $name, 'Autoload test', '', $autoload_value );
Note: See TracChangeset for help on using the changeset viewer.