Make WordPress Core

Changeset 54889


Ignore:
Timestamp:
11/29/2022 12:32:37 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Add visibility to methods in tests/phpunit/tests/.

Adds a public visibility to test fixtures, tests, data providers, and callbacks methods. This continues the previous efforts to make sure visibility is declared on all methods.

Note: This will be enforced by WPCS 3.0.0.

Follow-up to [51919], [52009], [52010].

Props jrf.
See #56791.

Location:
trunk/tests/phpunit/tests
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/wpCommentsListTable.php

    r54215 r54889  
    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' ) );
  • trunk/tests/phpunit/tests/admin/wpPostCommentsListTable.php

    r54215 r54889  
    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' ) );
  • trunk/tests/phpunit/tests/admin/wpPostsListTable.php

    r54663 r54889  
    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' ) );
     
    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(
     
    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(
     
    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(
     
    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(
     
    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(
     
    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(
     
    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';
     
    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';
     
    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';
  • trunk/tests/phpunit/tests/block-supports/border.php

    r54211 r54889  
    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;
     
    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(
     
    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(
     
    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(
  • trunk/tests/phpunit/tests/block-supports/colors.php

    r54211 r54889  
    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;
     
    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(
     
    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(
     
    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(
  • trunk/tests/phpunit/tests/block-supports/layout.php

    r53916 r54889  
    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' );
     
    5151        }
    5252
    53         function tear_down() {
     53        public function tear_down() {
    5454                $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
    5555
     
    6464        }
    6565
    66         function filter_set_theme_root() {
     66        public function filter_set_theme_root() {
    6767                return $this->theme_root;
    6868        }
     
    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' );
     
    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' );
     
    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' );
     
    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(
  • trunk/tests/phpunit/tests/block-supports/spacing.php

    r54211 r54889  
    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;
     
    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(
     
    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(
     
    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(
  • trunk/tests/phpunit/tests/block-supports/typography.php

    r54823 r54889  
    2424        private $orig_theme_dir;
    2525
    26         function set_up() {
     26        public function set_up() {
    2727                parent::set_up();
    2828
     
    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;
     
    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(
     
    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(
     
    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(
     
    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(
     
    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(
     
    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(
     
    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
  • trunk/tests/phpunit/tests/block-template-utils.php

    r54860 r54889  
    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
     
    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(
     
    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
     
    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"} /-->';
     
    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(
     
    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' );
     
    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 );
     
    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' );
  • trunk/tests/phpunit/tests/block-template.php

    r53093 r54889  
    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';
     
    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';
     
    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';
     
    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;
     
    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
     
    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
  • trunk/tests/phpunit/tests/blocks/renderCommentTemplate.php

    r53430 r54889  
    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 -->'
     
    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(
     
    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 -->'
     
    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' );
     
    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.
     
    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 -->'
     
    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,
     
    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/";
     
    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 -->'
     
    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 -->'
  • trunk/tests/phpunit/tests/functions.php

    r54861 r54889  
    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(
  • trunk/tests/phpunit/tests/kses.php

    r54675 r54889  
    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        }
     
    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(
     
    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 ) );
     
    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(
     
    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" />
     
    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(
     
    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        }
     
    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(
     
    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        }
     
    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(
  • trunk/tests/phpunit/tests/media.php

    r54802 r54889  
    34783478         * @param string $context
    34793479         */
    3480         function test_wp_get_loading_attr_default( $context ) {
     3480        public function test_wp_get_loading_attr_default( $context ) {
    34813481                global $wp_query, $wp_the_query;
    34823482
     
    35163516        }
    35173517
    3518         function data_wp_get_loading_attr_default() {
     3518        public function data_wp_get_loading_attr_default() {
    35193519                return array(
    35203520                        array( 'the_content' ),
     
    35263526         * @ticket 53675
    35273527         */
    3528         function test_wp_omit_loading_attr_threshold_filter() {
     3528        public function test_wp_omit_loading_attr_threshold_filter() {
    35293529                global $wp_query, $wp_the_query;
    35303530
     
    35583558         * @ticket 53675
    35593559         */
    3560         function test_wp_filter_content_tags_with_wp_get_loading_attr_default() {
     3560        public function test_wp_filter_content_tags_with_wp_get_loading_attr_default() {
    35613561                global $wp_query, $wp_the_query;
    35623562
  • trunk/tests/phpunit/tests/post/wpInsertPost.php

    r54402 r54889  
    880880         * @ticket 19954
    881881         */
    882         function test_updating_a_post_should_not_trash_categories() {
     882        public function test_updating_a_post_should_not_trash_categories() {
    883883                // Create a category and attach it to a new post.
    884884                $term_id = self::factory()->term->create(
  • trunk/tests/phpunit/tests/query/fieldsClause.php

    r54829 r54889  
    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        }
     
    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;
  • trunk/tests/phpunit/tests/theme/wpThemeJson.php

    r54855 r54889  
    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(
     
    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(
     
    27362736         * @ticket 55505
    27372737         */
    2738         function test_export_data() {
     2738        public function test_export_data() {
    27392739                $theme = new WP_Theme_JSON(
    27402740                        array(
     
    28142814         * @ticket 55505
    28152815         */
    2816         function test_export_data_deals_with_empty_user_data() {
     2816        public function test_export_data_deals_with_empty_user_data() {
    28172817                $theme = new WP_Theme_JSON(
    28182818                        array(
     
    28642864         * @ticket 55505
    28652865         */
    2866         function test_export_data_deals_with_empty_theme_data() {
     2866        public function test_export_data_deals_with_empty_theme_data() {
    28672867                $user = new WP_Theme_JSON(
    28682868                        array(
     
    29152915         * @ticket 55505
    29162916         */
    2917         function test_export_data_deals_with_empty_data() {
     2917        public function test_export_data_deals_with_empty_data() {
    29182918                $theme_v2    = new WP_Theme_JSON(
    29192919                        array(
     
    29402940         * @ticket 55505
    29412941         */
    2942         function test_export_data_sets_appearance_tools() {
     2942        public function test_export_data_sets_appearance_tools() {
    29432943                $theme = new WP_Theme_JSON(
    29442944                        array(
     
    29742974         * @ticket 56611
    29752975         */
    2976         function test_export_data_sets_use_root_padding_aware_alignments() {
     2976        public function test_export_data_sets_use_root_padding_aware_alignments() {
    29772977                $theme = new WP_Theme_JSON(
    29782978                        array(
     
    35073507         * @ticket 56467
    35083508         */
    3509         function test_get_styles_for_block_with_padding_aware_alignments() {
     3509        public function test_get_styles_for_block_with_padding_aware_alignments() {
    35103510                $theme_json = new WP_Theme_JSON(
    35113511                        array(
     
    35413541         * @ticket 56467
    35423542         */
    3543         function test_get_styles_for_block_without_padding_aware_alignments() {
     3543        public function test_get_styles_for_block_without_padding_aware_alignments() {
    35443544                $theme_json = new WP_Theme_JSON(
    35453545                        array(
     
    35723572         * @ticket 56467
    35733573         */
    3574         function test_get_styles_for_block_with_content_width() {
     3574        public function test_get_styles_for_block_with_content_width() {
    35753575                $theme_json = new WP_Theme_JSON(
    35763576                        array(
     
    35993599         * @ticket 56611
    36003600         */
    3601         function test_get_styles_with_appearance_tools() {
     3601        public function test_get_styles_with_appearance_tools() {
    36023602                $theme_json = new WP_Theme_JSON(
    36033603                        array(
     
    36293629         * @param array $expected_output Expected output from data provider.
    36303630         */
    3631         function test_should_set_spacing_sizes( $spacing_scale, $expected_output ) {
     3631        public function test_should_set_spacing_sizes( $spacing_scale, $expected_output ) {
    36323632                $theme_json = new WP_Theme_JSON(
    36333633                        array(
     
    36523652         * @return array
    36533653         */
    3654         function data_generate_spacing_scale_fixtures() {
     3654        public function data_generate_spacing_scale_fixtures() {
    36553655                return array(
    36563656                        'only one value when single step in spacing scale' => array(
     
    39463946         * @return array
    39473947         */
    3948         function data_set_spacing_sizes_when_invalid() {
     3948        public function data_set_spacing_sizes_when_invalid() {
    39493949                return array(
    39503950                        'missing operator value'  => array(
     
    40344034         * @return array
    40354035         */
    4036         function data_update_separator_declarations() {
     4036        public function data_update_separator_declarations() {
    40374037                return array(
    40384038                        // If only background is defined, test that includes border-color to the style so it is applied on the front end.
  • trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php

    r54799 r54889  
    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(
     
    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
     
    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' );
     
    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' );
     
    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' );
     
    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' );
     
    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' );
     
    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' );
     
    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();
     
    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' );
  • trunk/tests/phpunit/tests/theme/wpThemeJsonSchema.php

    r52049 r54889  
    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,
  • trunk/tests/phpunit/tests/user/query.php

    r54402 r54889  
    20122012         * @return array
    20132013         */
    2014         function data_returning_field_subset_as_string() {
     2014        public function data_returning_field_subset_as_string() {
    20152015                $data = array(
    20162016                        'id'            => array(
     
    20942094         * @return array
    20952095         */
    2096         function data_returning_field_subset_as_array() {
     2096        public function data_returning_field_subset_as_array() {
    20972097                $data = array(
    20982098                        'id'                 => array(
  • trunk/tests/phpunit/tests/widgets.php

    r54872 r54889  
    594594         * @ticket 52728
    595595         */
    596         function test_widget_display_callback_handles_arrayobject() {
     596        public function test_widget_display_callback_handles_arrayobject() {
    597597                $widget = new WP_Widget_Text();
    598598
Note: See TracChangeset for help on using the changeset viewer.