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

    r51524 r52010  
    66class Tests_Option_Theme_Mods extends WP_UnitTestCase {
    77
    8         function test_theme_mod_default() {
     8        public function test_theme_mod_default() {
    99                $this->assertFalse( get_theme_mod( 'non_existent' ) );
    1010        }
    1111
    12         function test_theme_mod_defined_default() {
     12        public function test_theme_mod_defined_default() {
    1313                $this->assertSame( 'default', get_theme_mod( 'non_existent', 'default' ) );
    1414        }
    1515
    16         function test_theme_mod_set() {
     16        public function test_theme_mod_set() {
    1717                $expected = 'value';
    1818                set_theme_mod( 'test_name', $expected );
     
    2323         * @ticket 51423
    2424         */
    25         function test_theme_mod_set_with_invalid_theme_mods_option() {
     25        public function test_theme_mod_set_with_invalid_theme_mods_option() {
    2626                $theme_slug = get_option( 'stylesheet' );
    2727                update_option( 'theme_mods_' . $theme_slug, '' );
     
    2929        }
    3030
    31         function test_theme_mod_update() {
     31        public function test_theme_mod_update() {
    3232                set_theme_mod( 'test_update', 'first_value' );
    3333                $expected = 'updated_value';
     
    3636        }
    3737
    38         function test_theme_mod_remove() {
     38        public function test_theme_mod_remove() {
    3939                set_theme_mod( 'test_remove', 'value' );
    4040                remove_theme_mod( 'test_remove' );
     
    4747         * @dataProvider data_theme_mod_default_value_with_percent_symbols
    4848         */
    49         function test_theme_mod_default_value_with_percent_symbols( $default, $expected ) {
     49        public function test_theme_mod_default_value_with_percent_symbols( $default, $expected ) {
    5050                $this->assertSame( $expected, get_theme_mod( 'test_name', $default ) );
    5151        }
    5252
    53         function data_theme_mod_default_value_with_percent_symbols() {
     53        public function data_theme_mod_default_value_with_percent_symbols() {
    5454                return array(
    5555                        array(
Note: See TracChangeset for help on using the changeset viewer.