Make WordPress Core


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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' );
Note: See TracChangeset for help on using the changeset viewer.