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

    r51568 r52010  
    2020        protected $manager;
    2121
    22         function set_up() {
     22        public function set_up() {
    2323                parent::set_up();
    2424                require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
     
    2828        }
    2929
    30         function tear_down() {
     30        public function tear_down() {
    3131                $this->manager = null;
    3232                unset( $GLOBALS['wp_customize'] );
     
    3737         * @see WP_Customize_Section::__construct()
    3838         */
    39         function test_construct_default_args() {
     39        public function test_construct_default_args() {
    4040                $section = new WP_Customize_Section( $this->manager, 'foo' );
    4141                $this->assertIsInt( $section->instance_number );
     
    5555         * @see WP_Customize_Section::__construct()
    5656         */
    57         function test_construct_custom_args() {
     57        public function test_construct_custom_args() {
    5858                $args = array(
    5959                        'priority'        => 200,
     
    7878         * @see WP_Customize_Section::__construct()
    7979         */
    80         function test_construct_custom_type() {
     80        public function test_construct_custom_type() {
    8181                $section = new Custom_Section_Test( $this->manager, 'foo' );
    8282                $this->assertSame( 'titleless', $section->type );
     
    8787         * @see WP_Customize_Section::active_callback()
    8888         */
    89         function test_active() {
     89        public function test_active() {
    9090                $section = new WP_Customize_Section( $this->manager, 'foo' );
    9191                $this->assertTrue( $section->active() );
     
    108108         * @return bool
    109109         */
    110         function filter_active_test( $active, $section ) {
     110        public function filter_active_test( $active, $section ) {
    111111                $this->assertFalse( $active );
    112112                $this->assertInstanceOf( 'WP_Customize_Section', $section );
     
    118118         * @see WP_Customize_Section::json()
    119119         */
    120         function test_json() {
     120        public function test_json() {
    121121                $args = array(
    122122                        'priority'        => 200,
     
    146146         * @see WP_Customize_Section::check_capabilities()
    147147         */
    148         function test_check_capabilities() {
     148        public function test_check_capabilities() {
    149149                wp_set_current_user( self::$admin_id );
    150150
     
    163163         * @see WP_Customize_Section::get_content()
    164164         */
    165         function test_get_content() {
     165        public function test_get_content() {
    166166                $section = new WP_Customize_Section( $this->manager, 'foo' );
    167167                $this->assertEmpty( $section->get_content() );
     
    171171         * @see WP_Customize_Section::maybe_render()
    172172         */
    173         function test_maybe_render() {
     173        public function test_maybe_render() {
    174174                wp_set_current_user( self::$admin_id );
    175175                $section                        = new WP_Customize_Section( $this->manager, 'bar' );
     
    189189         * @param WP_Customize_Section $section
    190190         */
    191         function action_customize_render_section_test( $section ) {
     191        public function action_customize_render_section_test( $section ) {
    192192                $this->assertInstanceOf( 'WP_Customize_Section', $section );
    193193        }
     
    196196         * @see WP_Customize_Section::print_template()
    197197         */
    198         function test_print_templates_standard() {
     198        public function test_print_templates_standard() {
    199199                wp_set_current_user( self::$admin_id );
    200200
     
    211211         * @see WP_Customize_Section::print_template()
    212212         */
    213         function test_print_templates_custom() {
     213        public function test_print_templates_custom() {
    214214                wp_set_current_user( self::$admin_id );
    215215
Note: See TracChangeset for help on using the changeset viewer.