Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (5 years ago)
Author:
hellofromTonya
Message:

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

Adds a public visibility to test fixtures, tests, data providers, and callbacks methods.

Adds a private visibility to helper methods within test classes.

Renames callbacks and helpers that previously started with a _ prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit.

Props costdev, jrf, hellofromTonya.
Fixes #54177.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/blocks/wpBlock.php

    r51894 r52010  
    4242        }
    4343
    44         function filter_render_block( $content, $parsed_block ) {
     44        public function filter_render_block( $content, $parsed_block ) {
    4545                return 'Original: "' . $content . '", from block "' . $parsed_block['blockName'] . '"';
    4646        }
     
    4949         * @ticket 49927
    5050         */
    51         function test_constructor_assigns_properties_from_parsed_block() {
     51        public function test_constructor_assigns_properties_from_parsed_block() {
    5252                $this->registry->register( 'core/example', array() );
    5353
     
    6767         * @ticket 49927
    6868         */
    69         function test_constructor_assigns_block_type_from_registry() {
     69        public function test_constructor_assigns_block_type_from_registry() {
    7070                $block_type_settings = array(
    7171                        'attributes' => array(
     
    9292         * @ticket 49927
    9393         */
    94         function test_lazily_assigns_attributes_with_defaults() {
     94        public function test_lazily_assigns_attributes_with_defaults() {
    9595                $this->registry->register(
    9696                        'core/example',
     
    126126         * @ticket 49927
    127127         */
    128         function test_lazily_assigns_attributes_with_only_defaults() {
     128        public function test_lazily_assigns_attributes_with_only_defaults() {
    129129                $this->registry->register(
    130130                        'core/example',
     
    154154         * @ticket 49927
    155155         */
    156         function test_constructor_assigns_context_from_block_type() {
     156        public function test_constructor_assigns_context_from_block_type() {
    157157                $this->registry->register(
    158158                        'core/example',
     
    175175         * @ticket 49927
    176176         */
    177         function test_constructor_maps_inner_blocks() {
     177        public function test_constructor_maps_inner_blocks() {
    178178                $this->registry->register( 'core/example', array() );
    179179
     
    191191         * @ticket 49927
    192192         */
    193         function test_constructor_prepares_context_for_inner_blocks() {
     193        public function test_constructor_prepares_context_for_inner_blocks() {
    194194                $this->registry->register(
    195195                        'core/outer',
     
    227227         * @ticket 49927
    228228         */
    229         function test_constructor_assigns_merged_context() {
     229        public function test_constructor_assigns_merged_context() {
    230230                $this->registry->register(
    231231                        'core/example',
     
    271271         * @ticket 49927
    272272         */
    273         function test_render_static_block_type_returns_own_content() {
     273        public function test_render_static_block_type_returns_own_content() {
    274274                $this->registry->register( 'core/static', array() );
    275275                $this->registry->register(
     
    293293         * @ticket 49927
    294294         */
    295         function test_render_passes_block_for_render_callback() {
     295        public function test_render_passes_block_for_render_callback() {
    296296                $this->registry->register(
    297297                        'core/greeting',
     
    314314         * @ticket 49927
    315315         */
    316         function test_render_applies_render_block_filter() {
     316        public function test_render_applies_render_block_filter() {
    317317                $this->registry->register( 'core/example', array() );
    318318
     
    334334         * @ticket 46187
    335335         */
    336         function test_render_applies_dynamic_render_block_filter() {
     336        public function test_render_applies_dynamic_render_block_filter() {
    337337                $this->registry->register( 'core/example', array() );
    338338
     
    354354         * @ticket 49927
    355355         */
    356         function test_passes_attributes_to_render_callback() {
     356        public function test_passes_attributes_to_render_callback() {
    357357                $this->registry->register(
    358358                        'core/greeting',
     
    388388         * @ticket 49927
    389389         */
    390         function test_passes_content_to_render_callback() {
     390        public function test_passes_content_to_render_callback() {
    391391                $this->registry->register(
    392392                        'core/outer',
Note: See TracChangeset for help on using the changeset viewer.