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/customize/nav-menu-setting.php

    r51568 r52010  
    2020         * @see WP_UnitTestCase::setup()
    2121         */
    22         function set_up() {
     22        public function set_up() {
    2323                parent::set_up();
    2424                require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
    … …  
    3333         * Delete the $wp_customize global when cleaning up scope.
    3434         */
    35         function clean_up_global_scope() {
     35        public function clean_up_global_scope() {
    3636                global $wp_customize;
    3737                $wp_customize = null;
    … …  
    4444         * @return array
    4545         */
    46         function get_nav_menu_items_option() {
     46        private function get_nav_menu_items_option() {
    4747                return get_option( 'nav_menu_options', array( 'auto_add' => array() ) );
    4848        }
    … …  
    5151         * Test constants and statics.
    5252         */
    53         function test_constants() {
     53        public function test_constants() {
    5454                do_action( 'customize_register', $this->wp_customize );
    5555                $this->assertTrue( taxonomy_exists( WP_Customize_Nav_Menu_Setting::TAXONOMY ) );
    … …  
    6161         * @see WP_Customize_Nav_Menu_Setting::__construct()
    6262         */
    63         function test_construct() {
     63        public function test_construct() {
    6464                do_action( 'customize_register', $this->wp_customize );
    6565
    … …  
    9292         * Test empty constructor.
    9393         */
    94         function test_construct_empty_menus() {
     94        public function test_construct_empty_menus() {
    9595                do_action( 'customize_register', $this->wp_customize );
    9696                $_wp_customize = $this->wp_customize;
    … …  
    112112         * @see WP_Customize_Nav_Menu_Setting::__construct()
    113113         */
    114         function test_construct_placeholder() {
     114        public function test_construct_placeholder() {
    115115                do_action( 'customize_register', $this->wp_customize );
    116116                $default = array(
    … …  
    129129         * @see WP_Customize_Nav_Menu_Setting::value()
    130130         */
    131         function test_value() {
     131        public function test_value() {
    132132                do_action( 'customize_register', $this->wp_customize );
    133133
    … …  
    169169         * @see WP_Customize_Nav_Menu_Setting::preview()
    170170         */
    171         function test_preview_updated() {
     171        public function test_preview_updated() {
    172172                do_action( 'customize_register', $this->wp_customize );
    173173
    … …  
    236236         * @see WP_Customize_Nav_Menu_Setting::preview()
    237237         */
    238         function test_preview_inserted() {
     238        public function test_preview_inserted() {
    239239                do_action( 'customize_register', $this->wp_customize );
    240240
    … …  
    281281         * @see WP_Customize_Nav_Menu_Setting::preview()
    282282         */
    283         function test_preview_deleted() {
     283        public function test_preview_deleted() {
    284284                do_action( 'customize_register', $this->wp_customize );
    285285
    … …  
    320320         * @see WP_Customize_Nav_Menu_Setting::sanitize()
    321321         */
    322         function test_sanitize() {
     322        public function test_sanitize() {
    323323                do_action( 'customize_register', $this->wp_customize );
    324324                $setting = new WP_Customize_Nav_Menu_Setting( $this->wp_customize, 'nav_menu[123]' );
    … …  
    351351         * @see WP_Customize_Nav_Menu_Setting::update()
    352352         */
    353         function test_save_updated() {
     353        public function test_save_updated() {
    354354                do_action( 'customize_register', $this->wp_customize );
    355355
    … …  
    416416         * @see WP_Customize_Nav_Menu_Setting::update()
    417417         */
    418         function test_save_inserted() {
     418        public function test_save_inserted() {
    419419                do_action( 'customize_register', $this->wp_customize );
    420420
    … …  
    465465         * @see WP_Customize_Nav_Menu_Setting::update()
    466466         */
    467         function test_save_inserted_conflicted_name() {
     467        public function test_save_inserted_conflicted_name() {
    468468                do_action( 'customize_register', $this->wp_customize );
    469469
    … …  
    490490         * @see WP_Customize_Nav_Menu_Setting::update()
    491491         */
    492         function test_save_deleted() {
     492        public function test_save_deleted() {
    493493                do_action( 'customize_register', $this->wp_customize );
    494494
Note: See TracChangeset for help on using the changeset viewer.