Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (3 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/admin/includesScreen.php

    r51639 r52010  
    156156    );
    157157
    158     function tear_down() {
     158    public function tear_down() {
    159159        unset( $GLOBALS['wp_taxonomies']['old-or-new'] );
    160160        parent::tear_down();
    161161    }
    162162
    163     function test_set_current_screen_with_hook_suffix() {
     163    public function test_set_current_screen_with_hook_suffix() {
    164164        global $current_screen;
    165165
     
    229229    }
    230230
    231     function test_post_type_as_hookname() {
     231    public function test_post_type_as_hookname() {
    232232        $screen = convert_to_screen( 'page' );
    233233        $this->assertSame( $screen->post_type, 'page' );
     
    237237    }
    238238
    239     function test_post_type_with_special_suffix_as_hookname() {
     239    public function test_post_type_with_special_suffix_as_hookname() {
    240240        register_post_type( 'value-add' );
    241241        $screen = convert_to_screen( 'value-add' ); // The '-add' part is key.
     
    252252    }
    253253
    254     function test_taxonomy_with_special_suffix_as_hookname() {
     254    public function test_taxonomy_with_special_suffix_as_hookname() {
    255255        register_taxonomy( 'old-or-new', 'post' );
    256256        $screen = convert_to_screen( 'edit-old-or-new' ); // The '-new' part is key.
     
    261261    }
    262262
    263     function test_post_type_with_edit_prefix() {
     263    public function test_post_type_with_edit_prefix() {
    264264        register_post_type( 'edit-some-thing' );
    265265        $screen = convert_to_screen( 'edit-some-thing' );
     
    276276    }
    277277
    278     function test_post_type_edit_collisions() {
     278    public function test_post_type_edit_collisions() {
    279279        register_post_type( 'comments' );
    280280        register_post_type( 'tags' );
     
    296296    }
    297297
    298     function test_help_tabs() {
     298    public function test_help_tabs() {
    299299        $tab      = __FUNCTION__;
    300300        $tab_args = array(
     
    332332     * @ticket 19828
    333333     */
    334     function test_help_tabs_priority() {
     334    public function test_help_tabs_priority() {
    335335        $tab_1      = 'tab1';
    336336        $tab_1_args = array(
     
    428428     * @ticket 25799
    429429     */
    430     function test_options() {
     430    public function test_options() {
    431431        $option      = __FUNCTION__;
    432432        $option_args = array(
     
    452452    }
    453453
    454     function test_in_admin() {
     454    public function test_in_admin() {
    455455        set_current_screen( 'edit.php' );
    456456        $this->assertTrue( get_current_screen()->in_admin() );
Note: See TracChangeset for help on using the changeset viewer.