Make WordPress Core

Ticket #56791: 56791-always-declare-visibility-for-methods.patch

File 56791-always-declare-visibility-for-methods.patch, 49.6 KB (added by jrf, 18 months ago)

Follow up to previous efforts to make sure visibility is declared on all methods. Note: this will be enforced by WPCS 3.0.0.

  • tests/phpunit/tests/admin/wpCommentsListTable.php

    From 583ed282ab73ad0e1ba098fb641f01c0ec5f684e Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Sun, 24 Jul 2022 00:07:10 +0200
    Subject: [PATCH] CS: always declare visibility for methods
    
    ---
     .../tests/admin/wpCommentsListTable.php       |  2 +-
     .../tests/admin/wpPostCommentsListTable.php   |  2 +-
     .../phpunit/tests/admin/wpPostsListTable.php  | 20 ++++++------
     tests/phpunit/tests/block-supports/border.php | 10 +++---
     tests/phpunit/tests/block-supports/colors.php | 10 +++---
     tests/phpunit/tests/block-supports/layout.php | 14 ++++----
     .../phpunit/tests/block-supports/spacing.php  | 10 +++---
     .../tests/block-supports/typography.php       | 18 +++++------
     tests/phpunit/tests/block-template-utils.php  | 18 +++++------
     tests/phpunit/tests/block-template.php        | 12 +++----
     .../tests/blocks/renderCommentTemplate.php    | 20 ++++++------
     tests/phpunit/tests/dependencies.php          |  2 +-
     tests/phpunit/tests/functions.php             |  2 +-
     tests/phpunit/tests/kses.php                  | 20 ++++++------
     tests/phpunit/tests/media.php                 |  8 ++---
     tests/phpunit/tests/post/wpInsertPost.php     |  2 +-
     tests/phpunit/tests/query/fieldsClause.php    |  4 +--
     tests/phpunit/tests/theme/wpThemeJson.php     | 32 +++++++++----------
     .../tests/theme/wpThemeJsonResolver.php       | 20 ++++++------
     .../phpunit/tests/theme/wpThemeJsonSchema.php |  2 +-
     tests/phpunit/tests/user/query.php            |  4 +--
     tests/phpunit/tests/widgets.php               |  2 +-
     22 files changed, 117 insertions(+), 117 deletions(-)
    
    diff --git a/tests/phpunit/tests/admin/wpCommentsListTable.php b/tests/phpunit/tests/admin/wpCommentsListTable.php
    index 20fcd836e2..a394823d37 100644
    a b class Tests_Admin_wpCommentsListTable extends WP_UnitTestCase { 
    1010         */
    1111        protected $table;
    1212
    13         function set_up() {
     13        public function set_up() {
    1414                parent::set_up();
    1515                $this->table = _get_list_table( 'WP_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
    1616        }
  • tests/phpunit/tests/admin/wpPostCommentsListTable.php

    diff --git a/tests/phpunit/tests/admin/wpPostCommentsListTable.php b/tests/phpunit/tests/admin/wpPostCommentsListTable.php
    index 98cb834bff..126126327f 100644
    a b class Tests_Admin_wpPostCommentsListTable extends WP_UnitTestCase { 
    1212         */
    1313        protected $table;
    1414
    15         function set_up() {
     15        public function set_up() {
    1616                parent::set_up();
    1717                $this->table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-post-comments' ) );
    1818        }
  • tests/phpunit/tests/admin/wpPostsListTable.php

    diff --git a/tests/phpunit/tests/admin/wpPostsListTable.php b/tests/phpunit/tests/admin/wpPostsListTable.php
    index 9e19ff3d8a..c2dd5f586a 100644
    a b class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    1414         */
    1515        protected $table;
    1616
    17         function set_up() {
     17        public function set_up() {
    1818                parent::set_up();
    1919                $this->table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => 'edit-page' ) );
    2020        }
    class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    7979         * @covers WP_Posts_List_Table::display_rows
    8080         * @covers WP_Posts_List_Table::set_hierarchical_display
    8181         */
    82         function test_list_hierarchical_pages_first_page() {
     82        public function test_list_hierarchical_pages_first_page() {
    8383                $this->_test_list_hierarchical_page(
    8484                        array(
    8585                                'paged'          => 1,
    class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    9898         * @covers WP_Posts_List_Table::display_rows
    9999         * @covers WP_Posts_List_Table::set_hierarchical_display
    100100         */
    101         function test_list_hierarchical_pages_second_page() {
     101        public function test_list_hierarchical_pages_second_page() {
    102102                $this->_test_list_hierarchical_page(
    103103                        array(
    104104                                'paged'          => 2,
    class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    118118         * @covers WP_Posts_List_Table::display_rows
    119119         * @covers WP_Posts_List_Table::set_hierarchical_display
    120120         */
    121         function test_search_hierarchical_pages_first_page() {
     121        public function test_search_hierarchical_pages_first_page() {
    122122                $this->_test_list_hierarchical_page(
    123123                        array(
    124124                                'paged'          => 1,
    class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    138138         * @covers WP_Posts_List_Table::display_rows
    139139         * @covers WP_Posts_List_Table::set_hierarchical_display
    140140         */
    141         function test_search_hierarchical_pages_second_page() {
     141        public function test_search_hierarchical_pages_second_page() {
    142142                $this->_test_list_hierarchical_page(
    143143                        array(
    144144                                'paged'          => 2,
    class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    158158         * @covers WP_Posts_List_Table::display_rows
    159159         * @covers WP_Posts_List_Table::set_hierarchical_display
    160160         */
    161         function test_grandchildren_hierarchical_pages_first_page() {
     161        public function test_grandchildren_hierarchical_pages_first_page() {
    162162                // Page 6 is the first page with grandchildren.
    163163                $this->_test_list_hierarchical_page(
    164164                        array(
    class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    180180         * @covers WP_Posts_List_Table::display_rows
    181181         * @covers WP_Posts_List_Table::set_hierarchical_display
    182182         */
    183         function test_grandchildren_hierarchical_pages_second_page() {
     183        public function test_grandchildren_hierarchical_pages_second_page() {
    184184                // Page 7 is the second page with grandchildren.
    185185                $this->_test_list_hierarchical_page(
    186186                        array(
    class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    260260         *
    261261         * @covers WP_Posts_List_Table::extra_tablenav
    262262         */
    263         function test_filter_button_should_not_be_shown_if_there_are_no_posts() {
     263        public function test_filter_button_should_not_be_shown_if_there_are_no_posts() {
    264264                // Set post type to a non-existent one.
    265265                $this->table->screen->post_type = 'foo';
    266266
    class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    276276         *
    277277         * @covers WP_Posts_List_Table::extra_tablenav
    278278         */
    279         function test_months_dropdown_should_not_be_shown_if_there_are_no_posts() {
     279        public function test_months_dropdown_should_not_be_shown_if_there_are_no_posts() {
    280280                // Set post type to a non-existent one.
    281281                $this->table->screen->post_type = 'foo';
    282282
    class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { 
    292292         *
    293293         * @covers WP_Posts_List_Table::extra_tablenav
    294294         */
    295         function test_category_dropdown_should_not_be_shown_if_there_are_no_posts() {
     295        public function test_category_dropdown_should_not_be_shown_if_there_are_no_posts() {
    296296                // Set post type to a non-existent one.
    297297                $this->table->screen->post_type = 'foo';
    298298
  • tests/phpunit/tests/block-supports/border.php

    diff --git a/tests/phpunit/tests/block-supports/border.php b/tests/phpunit/tests/block-supports/border.php
    index 204c8e43a0..aae4d4d2cc 100644
    a b class Test_Block_Supports_Border extends WP_UnitTestCase { 
    1010         */
    1111        private $test_block_name;
    1212
    13         function set_up() {
     13        public function set_up() {
    1414                parent::set_up();
    1515                $this->test_block_name = null;
    1616        }
    1717
    18         function tear_down() {
     18        public function tear_down() {
    1919                unregister_block_type( $this->test_block_name );
    2020                $this->test_block_name = null;
    2121                parent::set_up();
    class Test_Block_Supports_Border extends WP_UnitTestCase { 
    2424        /**
    2525         * @ticket 55505
    2626         */
    27         function test_border_color_slug_with_numbers_is_kebab_cased_properly() {
     27        public function test_border_color_slug_with_numbers_is_kebab_cased_properly() {
    2828                $this->test_block_name = 'test/border-color-slug-with-numbers-is-kebab-cased-properly';
    2929                register_block_type(
    3030                        $this->test_block_name,
    class Test_Block_Supports_Border extends WP_UnitTestCase { 
    7373        /**
    7474         * @ticket 55505
    7575         */
    76         function test_border_with_skipped_serialization_block_supports() {
     76        public function test_border_with_skipped_serialization_block_supports() {
    7777                $this->test_block_name = 'test/border-with-skipped-serialization-block-supports';
    7878                register_block_type(
    7979                        $this->test_block_name,
    class Test_Block_Supports_Border extends WP_UnitTestCase { 
    117117        /**
    118118         * @ticket 55505
    119119         */
    120         function test_radius_with_individual_skipped_serialization_block_supports() {
     120        public function test_radius_with_individual_skipped_serialization_block_supports() {
    121121                $this->test_block_name = 'test/radius-with-individual-skipped-serialization-block-supports';
    122122                register_block_type(
    123123                        $this->test_block_name,
  • tests/phpunit/tests/block-supports/colors.php

    diff --git a/tests/phpunit/tests/block-supports/colors.php b/tests/phpunit/tests/block-supports/colors.php
    index 109709e3d7..f9d302a741 100644
    a b class Tests_Block_Supports_Colors extends WP_UnitTestCase { 
    1010         */
    1111        private $test_block_name;
    1212
    13         function set_up() {
     13        public function set_up() {
    1414                parent::set_up();
    1515                $this->test_block_name = null;
    1616        }
    1717
    18         function tear_down() {
     18        public function tear_down() {
    1919                unregister_block_type( $this->test_block_name );
    2020                $this->test_block_name = null;
    2121                parent::set_up();
    class Tests_Block_Supports_Colors extends WP_UnitTestCase { 
    2424        /**
    2525         * @ticket 54337
    2626         */
    27         function test_color_slugs_with_numbers_are_kebab_cased_properly() {
     27        public function test_color_slugs_with_numbers_are_kebab_cased_properly() {
    2828                $this->test_block_name = 'test/color-slug-with-numbers';
    2929                register_block_type(
    3030                        $this->test_block_name,
    class Tests_Block_Supports_Colors extends WP_UnitTestCase { 
    6868        /**
    6969         * @ticket 55505
    7070         */
    71         function test_color_with_skipped_serialization_block_supports() {
     71        public function test_color_with_skipped_serialization_block_supports() {
    7272                $this->test_block_name = 'test/color-with-skipped-serialization-block-supports';
    7373                register_block_type(
    7474                        $this->test_block_name,
    class Tests_Block_Supports_Colors extends WP_UnitTestCase { 
    109109        /**
    110110         * @ticket 55505
    111111         */
    112         function test_gradient_with_individual_skipped_serialization_block_supports() {
     112        public function test_gradient_with_individual_skipped_serialization_block_supports() {
    113113                $this->test_block_name = 'test/gradient-with-individual-skipped-serialization-block-support';
    114114                register_block_type(
    115115                        $this->test_block_name,
  • tests/phpunit/tests/block-supports/layout.php

    diff --git a/tests/phpunit/tests/block-supports/layout.php b/tests/phpunit/tests/block-supports/layout.php
    index 3611c28efa..bcc21775ba 100644
    a b class Test_Block_Supports_Layout extends WP_UnitTestCase { 
    3232         */
    3333        private $orig_theme_dir;
    3434
    35         function set_up() {
     35        public function set_up() {
    3636                parent::set_up();
    3737                $this->theme_root     = realpath( DIR_TESTDATA . '/themedir1' );
    3838                $this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
    class Test_Block_Supports_Layout extends WP_UnitTestCase { 
    5050                unset( $GLOBALS['wp_themes'] );
    5151        }
    5252
    53         function tear_down() {
     53        public function tear_down() {
    5454                $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
    5555
    5656                // Clear up the filters to modify the theme root.
    class Test_Block_Supports_Layout extends WP_UnitTestCase { 
    6363                parent::tear_down();
    6464        }
    6565
    66         function filter_set_theme_root() {
     66        public function filter_set_theme_root() {
    6767                return $this->theme_root;
    6868        }
    6969
    7070        /**
    7171         * @ticket 55505
    7272         */
    73         function test_outer_container_not_restored_for_non_aligned_image_block_with_non_themejson_theme() {
     73        public function test_outer_container_not_restored_for_non_aligned_image_block_with_non_themejson_theme() {
    7474                // The "default" theme doesn't have theme.json support.
    7575                switch_theme( 'default' );
    7676                $block         = array(
    class Test_Block_Supports_Layout extends WP_UnitTestCase { 
    8686        /**
    8787         * @ticket 55505
    8888         */
    89         function test_outer_container_restored_for_aligned_image_block_with_non_themejson_theme() {
     89        public function test_outer_container_restored_for_aligned_image_block_with_non_themejson_theme() {
    9090                // The "default" theme doesn't have theme.json support.
    9191                switch_theme( 'default' );
    9292                $block         = array(
    class Test_Block_Supports_Layout extends WP_UnitTestCase { 
    107107         * @param string $block_image_html The block image HTML passed to `wp_restore_image_outer_container`.
    108108         * @param string $expected         The expected block image HTML.
    109109         */
    110         function test_additional_styles_moved_to_restored_outer_container_for_aligned_image_block_with_non_themejson_theme( $block_image_html, $expected ) {
     110        public function test_additional_styles_moved_to_restored_outer_container_for_aligned_image_block_with_non_themejson_theme( $block_image_html, $expected ) {
    111111                // The "default" theme doesn't have theme.json support.
    112112                switch_theme( 'default' );
    113113                $block = array(
    class Test_Block_Supports_Layout extends WP_UnitTestCase { 
    160160        /**
    161161         * @ticket 55505
    162162         */
    163         function test_outer_container_not_restored_for_aligned_image_block_with_themejson_theme() {
     163        public function test_outer_container_not_restored_for_aligned_image_block_with_themejson_theme() {
    164164                switch_theme( 'block-theme' );
    165165                $block         = array(
    166166                        'blockName' => 'core/image',
  • tests/phpunit/tests/block-supports/spacing.php

    diff --git a/tests/phpunit/tests/block-supports/spacing.php b/tests/phpunit/tests/block-supports/spacing.php
    index e0a849cf6b..4b5ada3798 100644
    a b class Test_Block_Supports_Spacing extends WP_UnitTestCase { 
    1010         */
    1111        private $test_block_name;
    1212
    13         function set_up() {
     13        public function set_up() {
    1414                parent::set_up();
    1515                $this->test_block_name = null;
    1616        }
    1717
    18         function tear_down() {
     18        public function tear_down() {
    1919                unregister_block_type( $this->test_block_name );
    2020                $this->test_block_name = null;
    2121                parent::set_up();
    class Test_Block_Supports_Spacing extends WP_UnitTestCase { 
    2424        /**
    2525         * @ticket 55505
    2626         */
    27         function test_spacing_style_is_applied() {
     27        public function test_spacing_style_is_applied() {
    2828                $this->test_block_name = 'test/spacing-style-is-applied';
    2929                register_block_type(
    3030                        $this->test_block_name,
    class Test_Block_Supports_Spacing extends WP_UnitTestCase { 
    7272        /**
    7373         * @ticket 55505
    7474         */
    75         function test_spacing_with_skipped_serialization_block_supports() {
     75        public function test_spacing_with_skipped_serialization_block_supports() {
    7676                $this->test_block_name = 'test/spacing-with-skipped-serialization-block-supports';
    7777                register_block_type(
    7878                        $this->test_block_name,
    class Test_Block_Supports_Spacing extends WP_UnitTestCase { 
    119119        /**
    120120         * @ticket 55505
    121121         */
    122         function test_margin_with_individual_skipped_serialization_block_supports() {
     122        public function test_margin_with_individual_skipped_serialization_block_supports() {
    123123                $this->test_block_name = 'test/margin-with-individual-skipped-serialization-block-supports';
    124124                register_block_type(
    125125                        $this->test_block_name,
  • tests/phpunit/tests/block-supports/typography.php

    diff --git a/tests/phpunit/tests/block-supports/typography.php b/tests/phpunit/tests/block-supports/typography.php
    index b9d16fbdf4..177a154b9e 100644
    a b class Tests_Block_Supports_Typography extends WP_UnitTestCase { 
    2323         */
    2424        private $orig_theme_dir;
    2525
    26         function set_up() {
     26        public function set_up() {
    2727                parent::set_up();
    2828
    2929                $this->test_block_name = null;
    class Tests_Block_Supports_Typography extends WP_UnitTestCase { 
    4848        /**
    4949         * Unregisters block type after each test.
    5050         */
    51         function tear_down() {
     51        public function tear_down() {
    5252                // Restores the original theme directory setup.
    5353                $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
    5454                wp_clean_themes_cache();
    class Tests_Block_Supports_Typography extends WP_UnitTestCase { 
    6868         *
    6969         * @covers ::wp_apply_typography_support
    7070         */
    71         function test_should_kebab_case_font_size_slug_with_numbers() {
     71        public function test_should_kebab_case_font_size_slug_with_numbers() {
    7272                $this->test_block_name = 'test/font-size-slug-with-numbers';
    7373                register_block_type(
    7474                        $this->test_block_name,
    class Tests_Block_Supports_Typography extends WP_UnitTestCase { 
    104104         *
    105105         * @covers ::wp_apply_typography_support
    106106         */
    107         function test_should_generate_font_family_with_legacy_inline_styles_using_a_value() {
     107        public function test_should_generate_font_family_with_legacy_inline_styles_using_a_value() {
    108108                $this->test_block_name = 'test/font-family-with-inline-styles-using-value';
    109109                register_block_type(
    110110                        $this->test_block_name,
    class Tests_Block_Supports_Typography extends WP_UnitTestCase { 
    139139         *
    140140         * @covers ::wp_apply_typography_support
    141141         */
    142         function test_should_skip_serialization_for_typography_block_supports() {
     142        public function test_should_skip_serialization_for_typography_block_supports() {
    143143                $this->test_block_name = 'test/typography-with-skipped-serialization-block-supports';
    144144                register_block_type(
    145145                        $this->test_block_name,
    class Tests_Block_Supports_Typography extends WP_UnitTestCase { 
    187187         *
    188188         * @covers ::wp_apply_typography_support
    189189         */
    190         function test_should_skip_serialization_for_letter_spacing_block_supports() {
     190        public function test_should_skip_serialization_for_letter_spacing_block_supports() {
    191191                $this->test_block_name = 'test/letter-spacing-with-individual-skipped-serialization-block-supports';
    192192                register_block_type(
    193193                        $this->test_block_name,
    class Tests_Block_Supports_Typography extends WP_UnitTestCase { 
    225225         *
    226226         * @covers ::wp_apply_typography_support
    227227         */
    228         function test_should_generate_css_var_for_font_family_with_legacy_inline_styles() {
     228        public function test_should_generate_css_var_for_font_family_with_legacy_inline_styles() {
    229229                $this->test_block_name = 'test/font-family-with-inline-styles-using-css-var';
    230230                register_block_type(
    231231                        $this->test_block_name,
    class Tests_Block_Supports_Typography extends WP_UnitTestCase { 
    260260         *
    261261         * @covers ::wp_apply_typography_support
    262262         */
    263         function test_should_generate_classname_for_font_family() {
     263        public function test_should_generate_classname_for_font_family() {
    264264                $this->test_block_name = 'test/font-family-with-class';
    265265                register_block_type(
    266266                        $this->test_block_name,
    class Tests_Block_Supports_Typography extends WP_UnitTestCase { 
    308308         * @param bool   $should_use_fluid_typography An override to switch fluid typography "on". Can be used for unit testing.
    309309         * @param string $expected_output             Expected output.
    310310         */
    311         function test_wp_get_typography_font_size_value( $font_size_preset, $should_use_fluid_typography, $expected_output ) {
     311        public function test_wp_get_typography_font_size_value( $font_size_preset, $should_use_fluid_typography, $expected_output ) {
    312312                $actual = wp_get_typography_font_size_value( $font_size_preset, $should_use_fluid_typography );
    313313
    314314                $this->assertSame( $expected_output, $actual );
  • tests/phpunit/tests/block-template-utils.php

    diff --git a/tests/phpunit/tests/block-template-utils.php b/tests/phpunit/tests/block-template-utils.php
    index a77f7e9d81..6e4a5b9e5c 100644
    a b class Tests_Block_Template_Utils extends WP_UnitTestCase { 
    131131         *
    132132         * @covers ::_build_block_template_result_from_post
    133133         */
    134         function test_build_block_template_result_from_post_with_child_theme() {
     134        public function test_build_block_template_result_from_post_with_child_theme() {
    135135                switch_theme( 'block-theme-child' );
    136136
    137137                $template = _build_block_template_result_from_post(
    class Tests_Block_Template_Utils extends WP_UnitTestCase { 
    142142                $this->assertSame( self::TEST_THEME, $template->theme );
    143143        }
    144144
    145         function test_build_block_template_result_from_file() {
     145        public function test_build_block_template_result_from_file() {
    146146                $template = _build_block_template_result_from_file(
    147147                        array(
    148148                                'slug' => 'single',
    class Tests_Block_Template_Utils extends WP_UnitTestCase { 
    188188         *
    189189         * @covers ::_build_block_template_result_from_file
    190190         */
    191         function test_build_block_template_result_from_file_with_child_theme() {
     191        public function test_build_block_template_result_from_file_with_child_theme() {
    192192                switch_theme( 'block-theme-child' );
    193193
    194194                $template = _build_block_template_result_from_file(
    class Tests_Block_Template_Utils extends WP_UnitTestCase { 
    203203                $this->assertSame( self::TEST_THEME, $template->theme );
    204204        }
    205205
    206         function test_inject_theme_attribute_in_block_template_content() {
     206        public function test_inject_theme_attribute_in_block_template_content() {
    207207                $theme                           = get_stylesheet();
    208208                $content_without_theme_attribute = '<!-- wp:template-part {"slug":"header","align":"full", "tagName":"header","className":"site-header"} /-->';
    209209                $template_content                = _inject_theme_attribute_in_block_template_content(
    class Tests_Block_Template_Utils extends WP_UnitTestCase { 
    249249         *
    250250         * @dataProvider data_remove_theme_attribute_in_block_template_content
    251251         */
    252         function test_remove_theme_attribute_in_block_template_content( $template_content, $expected ) {
     252        public function test_remove_theme_attribute_in_block_template_content( $template_content, $expected ) {
    253253                $this->assertSame( $expected, _remove_theme_attribute_in_block_template_content( $template_content ) );
    254254        }
    255255
    256         function data_remove_theme_attribute_in_block_template_content() {
     256        public function data_remove_theme_attribute_in_block_template_content() {
    257257                return array(
    258258                        array(
    259259                                '<!-- wp:template-part {"slug":"header","theme":"tt1-blocks","align":"full","tagName":"header","className":"site-header"} /-->',
    class Tests_Block_Template_Utils extends WP_UnitTestCase { 
    279279        /**
    280280         * Should retrieve the template from the theme files.
    281281         */
    282         function test_get_block_template_from_file() {
     282        public function test_get_block_template_from_file() {
    283283                $id       = get_stylesheet() . '//' . 'index';
    284284                $template = get_block_template( $id, 'wp_template' );
    285285                $this->assertSame( $id, $template->id );
    class Tests_Block_Template_Utils extends WP_UnitTestCase { 
    329329        /**
    330330         * Should flatten nested blocks
    331331         */
    332         function test_flatten_blocks() {
     332        public function test_flatten_blocks() {
    333333                $content_template_part_inside_group = '<!-- wp:group --><!-- wp:template-part {"slug":"header"} /--><!-- /wp:group -->';
    334334                $blocks                             = parse_blocks( $content_template_part_inside_group );
    335335                $actual                             = _flatten_blocks( $blocks );
    class Tests_Block_Template_Utils extends WP_UnitTestCase { 
    355355         * @ticket 54448
    356356         * @requires extension zip
    357357         */
    358         function test_wp_generate_block_templates_export_file() {
     358        public function test_wp_generate_block_templates_export_file() {
    359359                $filename = wp_generate_block_templates_export_file();
    360360                $this->assertFileExists( $filename, 'zip file is created at the specified path' );
    361361                $this->assertTrue( filesize( $filename ) > 0, 'zip file is larger than 0 bytes' );
  • tests/phpunit/tests/block-template.php

    diff --git a/tests/phpunit/tests/block-template.php b/tests/phpunit/tests/block-template.php
    index b53aa496b0..5439ac3793 100644
    a b class Tests_Block_Template extends WP_UnitTestCase { 
    2828                parent::tear_down();
    2929        }
    3030
    31         function test_page_home_block_template_takes_precedence_over_less_specific_block_templates() {
     31        public function test_page_home_block_template_takes_precedence_over_less_specific_block_templates() {
    3232                global $_wp_current_template_content;
    3333                $type                   = 'page';
    3434                $templates              = array(
    class Tests_Block_Template extends WP_UnitTestCase { 
    4141                $this->assertStringEqualsFile( get_stylesheet_directory() . '/templates/page-home.html', $_wp_current_template_content );
    4242        }
    4343
    44         function test_page_block_template_takes_precedence() {
     44        public function test_page_block_template_takes_precedence() {
    4545                global $_wp_current_template_content;
    4646                $type                   = 'page';
    4747                $templates              = array(
    class Tests_Block_Template extends WP_UnitTestCase { 
    5454                $this->assertStringEqualsFile( get_stylesheet_directory() . '/templates/page.html', $_wp_current_template_content );
    5555        }
    5656
    57         function test_block_template_takes_precedence_over_equally_specific_php_template() {
     57        public function test_block_template_takes_precedence_over_equally_specific_php_template() {
    5858                global $_wp_current_template_content;
    5959                $type                   = 'index';
    6060                $templates              = array(
    class Tests_Block_Template extends WP_UnitTestCase { 
    7171         *
    7272         * Covers https://github.com/WordPress/gutenberg/pull/29026.
    7373         */
    74         function test_more_specific_php_template_takes_precedence_over_less_specific_block_template() {
     74        public function test_more_specific_php_template_takes_precedence_over_less_specific_block_template() {
    7575                $page_id_template       = 'page-1.php';
    7676                $page_id_template_path  = get_stylesheet_directory() . '/' . $page_id_template;
    7777                $type                   = 'page';
    class Tests_Block_Template extends WP_UnitTestCase { 
    9393         * Covers https://core.trac.wordpress.org/ticket/54515.
    9494         *
    9595         */
    96         function test_child_theme_php_template_takes_precedence_over_equally_specific_parent_theme_block_template() {
     96        public function test_child_theme_php_template_takes_precedence_over_equally_specific_parent_theme_block_template() {
    9797                switch_theme( 'block-theme-child' );
    9898
    9999                $page_slug_template      = 'page-home.php';
    class Tests_Block_Template extends WP_UnitTestCase { 
    108108                $this->assertSame( $page_slug_template_path, $resolved_template_path );
    109109        }
    110110
    111         function test_child_theme_block_template_takes_precedence_over_equally_specific_parent_theme_php_template() {
     111        public function test_child_theme_block_template_takes_precedence_over_equally_specific_parent_theme_php_template() {
    112112                global $_wp_current_template_content;
    113113
    114114                switch_theme( 'block-theme-child' );
  • tests/phpunit/tests/blocks/renderCommentTemplate.php

    diff --git a/tests/phpunit/tests/blocks/renderCommentTemplate.php b/tests/phpunit/tests/blocks/renderCommentTemplate.php
    index 848b2caf38..5bfcd76487 100644
    a b class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase { 
    8787         * @ticket 55505
    8888         * @covers ::build_comment_query_vars_from_block
    8989         */
    90         function test_build_comment_query_vars_from_block_with_context() {
     90        public function test_build_comment_query_vars_from_block_with_context() {
    9191                $parsed_blocks = parse_blocks(
    9292                        '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->'
    9393                );
    class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase { 
    118118         * @ticket 55567
    119119         * @covers ::build_comment_query_vars_from_block
    120120         */
    121         function test_build_comment_query_vars_from_block_with_context_no_pagination() {
     121        public function test_build_comment_query_vars_from_block_with_context_no_pagination() {
    122122                update_option( 'page_comments', false );
    123123                $parsed_blocks = parse_blocks(
    124124                        '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->'
    class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase { 
    148148         * @ticket 55505
    149149         * @covers ::build_comment_query_vars_from_block
    150150         */
    151         function test_build_comment_query_vars_from_block_no_context() {
     151        public function test_build_comment_query_vars_from_block_no_context() {
    152152                $parsed_blocks = parse_blocks(
    153153                        '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->'
    154154                );
    class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase { 
    178178         * @ticket 55658
    179179         * @covers ::build_comment_query_vars_from_block
    180180         */
    181         function test_build_comment_query_vars_from_block_pagination_with_no_comments() {
     181        public function test_build_comment_query_vars_from_block_pagination_with_no_comments() {
    182182                $comments_per_page     = get_option( 'comments_per_page' );
    183183                $default_comments_page = get_option( 'default_comments_page' );
    184184
    class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase { 
    230230         * @ticket 55505
    231231         * @covers ::build_comment_query_vars_from_block
    232232         */
    233         function test_build_comment_query_vars_from_block_sets_cpage_var() {
     233        public function test_build_comment_query_vars_from_block_sets_cpage_var() {
    234234
    235235                // This could be any number, we set a fixed one instead of a random for better performance.
    236236                $comment_query_max_num_pages = 5;
    class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase { 
    267267         *
    268268         * @ticket 55567
    269269         */
    270         function test_rendering_comment_template() {
     270        public function test_rendering_comment_template() {
    271271                $parsed_blocks = parse_blocks(
    272272                        '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->'
    273273                );
    class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase { 
    295295         *
    296296         * @ticket 55567
    297297         */
    298         function test_rendering_comment_template_nested() {
     298        public function test_rendering_comment_template_nested() {
    299299                $first_level_ids = self::factory()->comment->create_post_comments(
    300300                        self::$custom_post->ID,
    301301                        2,
    END 
    396396         *
    397397         * @ticket 55643
    398398         */
    399         function test_render_block_core_comment_content_converts_to_html() {
     399        public function test_render_block_core_comment_content_converts_to_html() {
    400400                $comment_id  = self::$comment_ids[0];
    401401                $new_content = "Paragraph One\n\nP2L1\nP2L2\n\nhttps://example.com/";
    402402                self::factory()->comment->update_object(
    END 
    430430         * @ticket 55634
    431431         * @covers ::build_comment_query_vars_from_block
    432432         */
    433         function test_build_comment_query_vars_from_block_with_comment_preview() {
     433        public function test_build_comment_query_vars_from_block_with_comment_preview() {
    434434                $parsed_blocks = parse_blocks(
    435435                        '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->'
    436436                );
    END 
    471471         *
    472472         * @ticket 55643
    473473         */
    474         function test_rendering_comment_template_unmoderated_preview() {
     474        public function test_rendering_comment_template_unmoderated_preview() {
    475475                $parsed_blocks = parse_blocks(
    476476                        '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->'
    477477                );
  • tests/phpunit/tests/dependencies.php

    diff --git a/tests/phpunit/tests/dependencies.php b/tests/phpunit/tests/dependencies.php
    index 91971beb88..39a2860fc3 100644
    a b class Tests_Dependencies extends WP_UnitTestCase { 
    135135                $this->assertFalse( $dep->query( 'one' ) );
    136136        }
    137137
    138         function test_enqueue_before_register() {
     138        public function test_enqueue_before_register() {
    139139                $dep = new WP_Dependencies();
    140140
    141141                $this->assertArrayNotHasKey( 'one', $dep->registered );
  • tests/phpunit/tests/functions.php

    diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php
    index 42d70fd774..71cd6b67d1 100644
    a b class Tests_Functions extends WP_UnitTestCase { 
    20692069         * @ticket 55505
    20702070         * @covers ::wp_recursive_ksort
    20712071         */
    2072         function test_wp_recursive_ksort() {
     2072        public function test_wp_recursive_ksort() {
    20732073                // Create an array to test.
    20742074                $theme_json = array(
    20752075                        'version'  => 1,
  • tests/phpunit/tests/kses.php

    diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php
    index 294cb84779..84787a4501 100644
    a b EOF; 
    16471647         * @param string $html     A string of HTML to test.
    16481648         * @param string $expected The expected result from KSES.
    16491649         */
    1650         function test_wp_kses_object_tag_allowed( $html, $expected ) {
     1650        public function test_wp_kses_object_tag_allowed( $html, $expected ) {
    16511651                $this->assertSame( $expected, wp_kses_post( $html ) );
    16521652        }
    16531653
    16541654        /**
    16551655         * Data provider for test_wp_kses_object_tag_allowed().
    16561656         */
    1657         function data_wp_kses_object_tag_allowed() {
     1657        public function data_wp_kses_object_tag_allowed() {
    16581658                return array(
    16591659                        'valid value for type'                    => array(
    16601660                                '<object type="application/pdf" data="https://example.org/foo.pdf" />',
    EOF; 
    17571757         * @param string $html     A string of HTML to test.
    17581758         * @param string $expected The expected result from KSES.
    17591759         */
    1760         function test_wp_kses_object_data_url_with_port_number_allowed( $html, $expected ) {
     1760        public function test_wp_kses_object_data_url_with_port_number_allowed( $html, $expected ) {
    17611761                add_filter( 'upload_dir', array( $this, 'wp_kses_upload_dir_filter' ), 10, 2 );
    17621762                $this->assertSame( $expected, wp_kses_post( $html ) );
    17631763        }
    EOF; 
    17651765        /**
    17661766         * Data provider for test_wp_kses_object_data_url_with_port_number_allowed().
    17671767         */
    1768         function data_wp_kses_object_data_url_with_port_number_allowed() {
     1768        public function data_wp_kses_object_data_url_with_port_number_allowed() {
    17691769                return array(
    17701770                        'url with port number'                   => array(
    17711771                                '<object type="application/pdf" data="https://example.org:8888/cat/foo.pdf" />',
    EOF; 
    18041804         *
    18051805         * @ticket 54261
    18061806         */
    1807         function test_wp_kses_object_added_in_html_filter() {
     1807        public function test_wp_kses_object_added_in_html_filter() {
    18081808                $html = <<<HTML
    18091809<object type="application/pdf" data="https://wordpress.org/foo.pdf" />
    18101810<object type="application/x-shockwave-flash" data="https://wordpress.org/foo.swf">
    HTML; 
    18211821                $this->assertSame( $html, $filtered_html );
    18221822        }
    18231823
    1824         function filter_wp_kses_object_added_in_html_filter( $tags, $context ) {
     1824        public function filter_wp_kses_object_added_in_html_filter( $tags, $context ) {
    18251825                if ( 'post' === $context ) {
    18261826                        $tags['object'] = array(
    18271827                                'type' => true,
    HTML; 
    18481848         * @param string $expected     The expected result from KSES.
    18491849         * @param array  $allowed_html The allowed HTML to pass to KSES.
    18501850         */
    1851         function test_wp_kses_allowed_values_list( $html, $expected, $allowed_html ) {
     1851        public function test_wp_kses_allowed_values_list( $html, $expected, $allowed_html ) {
    18521852                $this->assertSame( $expected, wp_kses( $html, $allowed_html ) );
    18531853        }
    18541854
    18551855        /**
    18561856         * Data provider for test_wp_kses_allowed_values_list().
    18571857         */
    1858         function data_wp_kses_allowed_values_list() {
     1858        public function data_wp_kses_allowed_values_list() {
    18591859                $data = array(
    18601860                        'valid dir attribute value'             => array(
    18611861                                '<p dir="ltr">foo</p>',
    HTML; 
    19061906         * @param string $expected     The expected result from KSES.
    19071907         * @param array  $allowed_html The allowed HTML to pass to KSES.
    19081908         */
    1909         function test_wp_kses_required_attribute( $html, $expected, $allowed_html ) {
     1909        public function test_wp_kses_required_attribute( $html, $expected, $allowed_html ) {
    19101910                $this->assertSame( $expected, wp_kses( $html, $allowed_html ) );
    19111911        }
    19121912
    19131913        /**
    19141914         * Data provider for test_wp_kses_required_attribute().
    19151915         */
    1916         function data_wp_kses_required_attribute() {
     1916        public function data_wp_kses_required_attribute() {
    19171917                $data = array(
    19181918                        'valid dir attribute value'             => array(
    19191919                                '<p dir="ltr">foo</p>', // Test HTML.
  • tests/phpunit/tests/media.php

    diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php
    index 3a8e6544d2..42cddc36b0 100644
    a b EOF; 
    34753475         *
    34763476         * @param string $context
    34773477         */
    3478         function test_wp_get_loading_attr_default( $context ) {
     3478        public function test_wp_get_loading_attr_default( $context ) {
    34793479                global $wp_query, $wp_the_query;
    34803480
    34813481                // Return 'lazy' by default.
    EOF; 
    35133513                }
    35143514        }
    35153515
    3516         function data_wp_get_loading_attr_default() {
     3516        public function data_wp_get_loading_attr_default() {
    35173517                return array(
    35183518                        array( 'the_content' ),
    35193519                        array( 'the_post_thumbnail' ),
    EOF; 
    35233523        /**
    35243524         * @ticket 53675
    35253525         */
    3526         function test_wp_omit_loading_attr_threshold_filter() {
     3526        public function test_wp_omit_loading_attr_threshold_filter() {
    35273527                global $wp_query, $wp_the_query;
    35283528
    35293529                $wp_query     = new WP_Query( array( 'post__in' => array( self::$post_ids['publish'] ) ) );
    EOF; 
    35553555        /**
    35563556         * @ticket 53675
    35573557         */
    3558         function test_wp_filter_content_tags_with_wp_get_loading_attr_default() {
     3558        public function test_wp_filter_content_tags_with_wp_get_loading_attr_default() {
    35593559                global $wp_query, $wp_the_query;
    35603560
    35613561                $img1         = get_image_tag( self::$large_id, '', '', '', 'large' );
  • tests/phpunit/tests/post/wpInsertPost.php

    diff --git a/tests/phpunit/tests/post/wpInsertPost.php b/tests/phpunit/tests/post/wpInsertPost.php
    index 43811e0919..6560be1796 100644
    a b class Tests_Post_wpInsertPost extends WP_UnitTestCase { 
    877877        /**
    878878         * @ticket 19954
    879879         */
    880         function test_updating_a_post_should_not_trash_categories() {
     880        public function test_updating_a_post_should_not_trash_categories() {
    881881                // Create a category and attach it to a new post.
    882882                $term_id = self::factory()->term->create(
    883883                        array(
  • tests/phpunit/tests/query/fieldsClause.php

    diff --git a/tests/phpunit/tests/query/fieldsClause.php b/tests/phpunit/tests/query/fieldsClause.php
    index d873857a65..87f78a8719 100644
    a b class Tests_Query_FieldsClause extends WP_UnitTestCase { 
    217217         * @param string $fields The fields to SELECT.
    218218         * @return string The filtered fields.
    219219         */
    220         function filter_posts_fields( $fields ) {
     220        public function filter_posts_fields( $fields ) {
    221221                return "$fields, 1 as test_post_fields";
    222222        }
    223223
    class Tests_Query_FieldsClause extends WP_UnitTestCase { 
    227227         * @param array $clauses The WP_Query database clauses.
    228228         * @return array The filtered database clauses.
    229229         */
    230         function filter_posts_clauses( $clauses ) {
     230        public function filter_posts_clauses( $clauses ) {
    231231                $clauses['fields'] .= ', 2 as test_post_clauses';
    232232                return $clauses;
    233233        }
  • tests/phpunit/tests/theme/wpThemeJson.php

    diff --git a/tests/phpunit/tests/theme/wpThemeJson.php b/tests/phpunit/tests/theme/wpThemeJson.php
    index 5fa8a15de9..e07e5f2486 100644
    a b class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    201201                $this->assertEqualSetsWithIndex( $expected_no_origin, $actual_no_origin );
    202202        }
    203203
    204         function test_get_settings_appearance_true_opts_in() {
     204        public function test_get_settings_appearance_true_opts_in() {
    205205                $theme_json = new WP_Theme_JSON(
    206206                        array(
    207207                                'version'  => WP_Theme_JSON::LATEST_SCHEMA,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    280280                $this->assertEqualSetsWithIndex( $expected, $actual );
    281281        }
    282282
    283         function test_get_settings_appearance_false_does_not_opt_in() {
     283        public function test_get_settings_appearance_false_does_not_opt_in() {
    284284                $theme_json = new WP_Theme_JSON(
    285285                        array(
    286286                                'version'  => WP_Theme_JSON::LATEST_SCHEMA,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    27342734        /**
    27352735         * @ticket 55505
    27362736         */
    2737         function test_export_data() {
     2737        public function test_export_data() {
    27382738                $theme = new WP_Theme_JSON(
    27392739                        array(
    27402740                                'version'  => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    28122812        /**
    28132813         * @ticket 55505
    28142814         */
    2815         function test_export_data_deals_with_empty_user_data() {
     2815        public function test_export_data_deals_with_empty_user_data() {
    28162816                $theme = new WP_Theme_JSON(
    28172817                        array(
    28182818                                'version'  => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    28622862        /**
    28632863         * @ticket 55505
    28642864         */
    2865         function test_export_data_deals_with_empty_theme_data() {
     2865        public function test_export_data_deals_with_empty_theme_data() {
    28662866                $user = new WP_Theme_JSON(
    28672867                        array(
    28682868                                'version'  => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    29132913        /**
    29142914         * @ticket 55505
    29152915         */
    2916         function test_export_data_deals_with_empty_data() {
     2916        public function test_export_data_deals_with_empty_data() {
    29172917                $theme_v2    = new WP_Theme_JSON(
    29182918                        array(
    29192919                                'version' => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    29382938        /**
    29392939         * @ticket 55505
    29402940         */
    2941         function test_export_data_sets_appearance_tools() {
     2941        public function test_export_data_sets_appearance_tools() {
    29422942                $theme = new WP_Theme_JSON(
    29432943                        array(
    29442944                                'version'  => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    29722972        /**
    29732973         * @ticket 56611
    29742974         */
    2975         function test_export_data_sets_use_root_padding_aware_alignments() {
     2975        public function test_export_data_sets_use_root_padding_aware_alignments() {
    29762976                $theme = new WP_Theme_JSON(
    29772977                        array(
    29782978                                'version'  => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    35053505        /**
    35063506         * @ticket 56467
    35073507         */
    3508         function test_get_styles_for_block_with_padding_aware_alignments() {
     3508        public function test_get_styles_for_block_with_padding_aware_alignments() {
    35093509                $theme_json = new WP_Theme_JSON(
    35103510                        array(
    35113511                                'version'  => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    35393539        /**
    35403540         * @ticket 56467
    35413541         */
    3542         function test_get_styles_for_block_without_padding_aware_alignments() {
     3542        public function test_get_styles_for_block_without_padding_aware_alignments() {
    35433543                $theme_json = new WP_Theme_JSON(
    35443544                        array(
    35453545                                'version' => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    35703570        /**
    35713571         * @ticket 56467
    35723572         */
    3573         function test_get_styles_for_block_with_content_width() {
     3573        public function test_get_styles_for_block_with_content_width() {
    35743574                $theme_json = new WP_Theme_JSON(
    35753575                        array(
    35763576                                'version'  => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    35973597        /**
    35983598         * @ticket 56611
    35993599         */
    3600         function test_get_styles_with_appearance_tools() {
     3600        public function test_get_styles_with_appearance_tools() {
    36013601                $theme_json = new WP_Theme_JSON(
    36023602                        array(
    36033603                                'version'  => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    36273627         * @param array $spacing_scale   Example spacing scale definitions from the data provider.
    36283628         * @param array $expected_output Expected output from data provider.
    36293629         */
    3630         function test_should_set_spacing_sizes( $spacing_scale, $expected_output ) {
     3630        public function test_should_set_spacing_sizes( $spacing_scale, $expected_output ) {
    36313631                $theme_json = new WP_Theme_JSON(
    36323632                        array(
    36333633                                'version'  => 2,
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    36503650         *
    36513651         * @return array
    36523652         */
    3653         function data_generate_spacing_scale_fixtures() {
     3653        public function data_generate_spacing_scale_fixtures() {
    36543654                return array(
    36553655                        'only one value when single step in spacing scale' => array(
    36563656                                'spacing_scale'   => array(
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    39443944         *
    39453945         * @return array
    39463946         */
    3947         function data_set_spacing_sizes_when_invalid() {
     3947        public function data_set_spacing_sizes_when_invalid() {
    39483948                return array(
    39493949                        'missing operator value'  => array(
    39503950                                'spacing_scale'   => array(
    class Tests_Theme_wpThemeJson extends WP_UnitTestCase { 
    40324032         *
    40334033         * @return array
    40344034         */
    4035         function data_update_separator_declarations() {
     4035        public function data_update_separator_declarations() {
    40364036                return array(
    40374037                        // If only background is defined, test that includes border-color to the style so it is applied on the front end.
    40384038                        'only background'                      => array(
  • tests/phpunit/tests/theme/wpThemeJsonResolver.php

    diff --git a/tests/phpunit/tests/theme/wpThemeJsonResolver.php b/tests/phpunit/tests/theme/wpThemeJsonResolver.php
    index 359bf58d00..8eaac663b0 100644
    a b class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    450450        /**
    451451         * @ticket 54336
    452452         */
    453         function test_add_theme_supports_are_loaded_for_themes_without_theme_json() {
     453        public function test_add_theme_supports_are_loaded_for_themes_without_theme_json() {
    454454                switch_theme( 'default' );
    455455                $color_palette = array(
    456456                        array(
    class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    498498         * @ticket 54336
    499499         * @ticket 56611
    500500         */
    501         function test_merges_child_theme_json_into_parent_theme_json() {
     501        public function test_merges_child_theme_json_into_parent_theme_json() {
    502502                switch_theme( 'block-theme-child' );
    503503
    504504                $actual_settings   = WP_Theme_JSON_Resolver::get_theme_data()->get_settings();
    class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    619619        /**
    620620         * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles
    621621         */
    622         function test_get_user_data_from_wp_global_styles_does_not_use_uncached_queries() {
     622        public function test_get_user_data_from_wp_global_styles_does_not_use_uncached_queries() {
    623623                // Switch to a theme that does have support.
    624624                switch_theme( 'block-theme' );
    625625                wp_set_current_user( self::$administrator_id );
    class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    659659        /**
    660660         * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles
    661661         */
    662         function test_get_user_data_from_wp_global_styles_does_not_use_uncached_queries_for_logged_out_users() {
     662        public function test_get_user_data_from_wp_global_styles_does_not_use_uncached_queries_for_logged_out_users() {
    663663                // Switch to a theme that does have support.
    664664                switch_theme( 'block-theme' );
    665665                $theme = wp_get_theme();
    class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    680680         * @ticket 56945
    681681         * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles
    682682         */
    683         function test_get_user_data_from_wp_global_styles_does_not_run_for_theme_without_support() {
     683        public function test_get_user_data_from_wp_global_styles_does_not_run_for_theme_without_support() {
    684684                // The 'default' theme does not support theme.json.
    685685                switch_theme( 'default' );
    686686                wp_set_current_user( self::$administrator_id );
    class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    702702         * @ticket 55392
    703703         * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles
    704704         */
    705         function test_get_user_data_from_wp_global_styles_does_exist() {
     705        public function test_get_user_data_from_wp_global_styles_does_exist() {
    706706                // Switch to a theme that does have support.
    707707                switch_theme( 'block-theme' );
    708708                $theme = wp_get_theme();
    class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    719719         * @ticket 55392
    720720         * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles
    721721         */
    722         function test_get_user_data_from_wp_global_styles_create_post() {
     722        public function test_get_user_data_from_wp_global_styles_create_post() {
    723723                // Switch to a theme that does have support.
    724724                switch_theme( 'block-theme' );
    725725                $theme = wp_get_theme( 'testing' );
    class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    738738         * @ticket 55392
    739739         * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles
    740740         */
    741         function test_get_user_data_from_wp_global_styles_filter_state() {
     741        public function test_get_user_data_from_wp_global_styles_filter_state() {
    742742                // Switch to a theme that does have support.
    743743                switch_theme( 'block-theme' );
    744744                $theme = wp_get_theme( 'foo' );
    class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    754754         * @ticket 56835
    755755         * @covers WP_Theme_JSON_Resolver::get_theme_data
    756756         */
    757         function test_get_theme_data_theme_supports_overrides_theme_json() {
     757        public function test_get_theme_data_theme_supports_overrides_theme_json() {
    758758                // Test that get_theme_data() returns a WP_Theme_JSON object.
    759759                $theme_json_resolver = new WP_Theme_JSON_Resolver();
    760760                $theme_data          = $theme_json_resolver->get_theme_data();
    class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { 
    777777         * @ticket 56945
    778778         * @covers WP_Theme_JSON_Resolver::get_theme_data
    779779         */
    780         function test_get_theme_data_does_not_parse_theme_json_if_not_present() {
     780        public function test_get_theme_data_does_not_parse_theme_json_if_not_present() {
    781781                // The 'default' theme does not support theme.json.
    782782                switch_theme( 'default' );
    783783
  • tests/phpunit/tests/theme/wpThemeJsonSchema.php

    diff --git a/tests/phpunit/tests/theme/wpThemeJsonSchema.php b/tests/phpunit/tests/theme/wpThemeJsonSchema.php
    index 25cfcf7c97..e93ef0673a 100644
    a b class Tests_Theme_wpThemeJsonSchema extends WP_UnitTestCase { 
    1919        /**
    2020         * @ticket 54336
    2121         */
    22         function test_migrate_v1_to_v2() {
     22        public function test_migrate_v1_to_v2() {
    2323                $theme_json_v1 = array(
    2424                        'version'  => 1,
    2525                        'settings' => array(
  • tests/phpunit/tests/user/query.php

    diff --git a/tests/phpunit/tests/user/query.php b/tests/phpunit/tests/user/query.php
    index 03bb0f9633..ac9678a908 100644
    a b class Tests_User_Query extends WP_UnitTestCase { 
    20102010         *
    20112011         * @return array
    20122012         */
    2013         function data_returning_field_subset_as_string() {
     2013        public function data_returning_field_subset_as_string() {
    20142014                $data = array(
    20152015                        'id'            => array(
    20162016                                'fields'   => 'id',
    class Tests_User_Query extends WP_UnitTestCase { 
    20922092         *
    20932093         * @return array
    20942094         */
    2095         function data_returning_field_subset_as_array() {
     2095        public function data_returning_field_subset_as_array() {
    20962096                $data = array(
    20972097                        'id'                 => array(
    20982098                                'fields'   => array( 'id' ),
  • tests/phpunit/tests/widgets.php

    diff --git a/tests/phpunit/tests/widgets.php b/tests/phpunit/tests/widgets.php
    index 007cf3665a..fd3826ec3d 100644
    a b class Tests_Widgets extends WP_UnitTestCase { 
    589589        /**
    590590         * @ticket 52728
    591591         */
    592         function test_widget_display_callback_handles_arrayobject() {
     592        public function test_widget_display_callback_handles_arrayobject() {
    593593                $widget = new WP_Widget_Text();
    594594
    595595                register_widget( $widget );