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/general/paginateLinks.php

    r51568 r52010  
    1010        private $i18n_count = 0;
    1111
    12         function set_up() {
     12        public function set_up() {
    1313                parent::set_up();
    1414
    … …  
    1616        }
    1717
    18         function test_defaults() {
     18        public function test_defaults() {
    1919                $page2  = get_pagenum_link( 2 );
    2020                $page3  = get_pagenum_link( 3 );
    … …  
    3434        }
    3535
    36         function test_format() {
     36        public function test_format() {
    3737                $page2  = home_url( '/page/2/' );
    3838                $page3  = home_url( '/page/3/' );
    … …  
    5757        }
    5858
    59         function test_prev_next_false() {
     59        public function test_prev_next_false() {
    6060                $home   = home_url( '/' );
    6161                $page3  = get_pagenum_link( 3 );
    … …  
    8282        }
    8383
    84         function test_prev_next_true() {
     84        public function test_prev_next_true() {
    8585                $home   = home_url( '/' );
    8686                $page3  = get_pagenum_link( 3 );
    … …  
    109109        }
    110110
    111         function increment_i18n_count() {
     111        public function increment_i18n_count() {
    112112                $this->i18n_count += 1;
    113113        }
    … …  
    116116         * @ticket 25735
    117117         */
    118         function test_paginate_links_number_format() {
     118        public function test_paginate_links_number_format() {
    119119                $this->i18n_count = 0;
    120120                add_filter( 'number_format_i18n', array( $this, 'increment_i18n_count' ) );
    … …  
    138138         * @ticket 24606
    139139         */
    140         function test_paginate_links_base_value() {
     140        public function test_paginate_links_base_value() {
    141141
    142142                // Current page: 2.
    … …  
    206206        }
    207207
    208         function add_query_arg( $url ) {
     208        public function add_query_arg( $url ) {
    209209                return add_query_arg(
    210210                        array(
    … …  
    219219         * @ticket 29636
    220220         */
    221         function test_paginate_links_query_args() {
     221        public function test_paginate_links_query_args() {
    222222                add_filter( 'get_pagenum_link', array( $this, 'add_query_arg' ) );
    223223                $links = paginate_links(
    … …  
    257257         * @ticket 30831
    258258         */
    259         function test_paginate_links_with_custom_query_args() {
     259        public function test_paginate_links_with_custom_query_args() {
    260260                add_filter( 'get_pagenum_link', array( $this, 'add_query_arg' ) );
    261261                $links = paginate_links(
Note: See TracChangeset for help on using the changeset viewer.