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/user/listAuthors.php

    r49603 r52010  
    7575        }
    7676
    77         function test_wp_list_authors_default() {
     77        public function test_wp_list_authors_default() {
    7878                $expected['default'] =
    7979                        '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a></li>' .
     
    8484        }
    8585
    86         function test_wp_list_authors_orderby() {
     86        public function test_wp_list_authors_orderby() {
    8787                $expected['post_count'] =
    8888                        '<li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a></li>' .
     
    101101        }
    102102
    103         function test_wp_list_authors_order() {
     103        public function test_wp_list_authors_order() {
    104104                $expected['id'] =
    105105                        '<li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a></li>' .
     
    119119        }
    120120
    121         function test_wp_list_authors_optioncount() {
     121        public function test_wp_list_authors_optioncount() {
    122122                $expected['optioncount'] =
    123123                        '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a> (2)</li>' .
     
    136136        }
    137137
    138         function test_wp_list_authors_exclude_admin() {
     138        public function test_wp_list_authors_exclude_admin() {
    139139                self::factory()->post->create(
    140140                        array(
     
    161161        }
    162162
    163         function test_wp_list_authors_show_fullname() {
     163        public function test_wp_list_authors_show_fullname() {
    164164                $expected['show_fullname'] =
    165165                        '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob reno</a></li>' .
     
    178178        }
    179179
    180         function test_wp_list_authors_hide_empty() {
     180        public function test_wp_list_authors_hide_empty() {
    181181                $fred_id = self::$fred_id;
    182182
     
    198198        }
    199199
    200         function test_wp_list_authors_echo() {
     200        public function test_wp_list_authors_echo() {
    201201                $expected['echo'] =
    202202                        '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a></li>' .
     
    208208        }
    209209
    210         function test_wp_list_authors_feed() {
     210        public function test_wp_list_authors_feed() {
    211211                $url0 = get_author_feed_link( self::$user_ids[0] );
    212212                $url1 = get_author_feed_link( self::$user_ids[1] );
     
    229229        }
    230230
    231         function test_wp_list_authors_feed_image() {
     231        public function test_wp_list_authors_feed_image() {
    232232                $url0 = get_author_feed_link( self::$user_ids[0] );
    233233                $url1 = get_author_feed_link( self::$user_ids[1] );
     
    253253         * @ticket 26538
    254254         */
    255         function test_wp_list_authors_feed_type() {
     255        public function test_wp_list_authors_feed_type() {
    256256                $url0 = get_author_feed_link( self::$user_ids[0], 'atom' );
    257257                $url1 = get_author_feed_link( self::$user_ids[1], 'atom' );
     
    275275        }
    276276
    277         function test_wp_list_authors_style() {
     277        public function test_wp_list_authors_style() {
    278278                $expected['style'] =
    279279                        '<a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a>, ' .
     
    292292        }
    293293
    294         function test_wp_list_authors_html() {
     294        public function test_wp_list_authors_html() {
    295295                $expected['html'] = 'bob, paul, zack';
    296296
Note: See TracChangeset for help on using the changeset viewer.