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/walker.php

    r51568 r52010  
    99class Tests_Walker extends WP_UnitTestCase {
    1010
    11     function set_up() {
     11    public function set_up() {
    1212        parent::set_up();
    1313
     
    1515    }
    1616
    17     function test_single_item() {
     17    public function test_single_item() {
    1818
    1919        $items  = array(
     
    3030    }
    3131
    32     function test_single_item_flat() {
     32    public function test_single_item_flat() {
    3333
    3434        $items  = array(
     
    4545    }
    4646
    47     function test_single_item_depth_1() {
     47    public function test_single_item_depth_1() {
    4848
    4949        $items  = array(
     
    6060    }
    6161
    62     function test_multiple_items_single_level() {
     62    public function test_multiple_items_single_level() {
    6363
    6464        $items = array(
     
    8080    }
    8181
    82     function test_multiple_items_multiple_levels() {
     82    public function test_multiple_items_multiple_levels() {
    8383
    8484        $items = array(
     
    100100    }
    101101
    102     function test_multiple_items_multiple_levels_flat() {
     102    public function test_multiple_items_multiple_levels_flat() {
    103103
    104104        $items = array(
     
    120120    }
    121121
    122     function test_multiple_items_multiple_levels_depth_1() {
     122    public function test_multiple_items_multiple_levels_depth_1() {
    123123
    124124        $items = array(
     
    140140    }
    141141
    142     function test_multiple_items_multiple_levels_depth_2() {
     142    public function test_multiple_items_multiple_levels_depth_2() {
    143143
    144144        $items = array(
     
    164164    }
    165165
    166     function test_multiple_items_recursive() {
     166    public function test_multiple_items_recursive() {
    167167
    168168        $items = array(
     
    184184    }
    185185
    186     function test_single_item_child() {
     186    public function test_single_item_child() {
    187187
    188188        $items = array(
     
    200200    }
    201201
    202     function test_single_item_missing_parent_depth_1() {
     202    public function test_single_item_missing_parent_depth_1() {
    203203
    204204        $items = array(
     
    223223    }
    224224
    225     function test_multiple_items_missing_parents() {
     225    public function test_multiple_items_missing_parents() {
    226226
    227227        $items = array(
     
    247247    }
    248248
    249     function test_multiple_items_missing_parents_depth_1() {
     249    public function test_multiple_items_missing_parents_depth_1() {
    250250
    251251        $items = array(
     
    284284     * @ticket 53474
    285285     */
    286     function test_multiple_items_non_numeric_parent() {
     286    public function test_multiple_items_non_numeric_parent() {
    287287
    288288        $items  = array(
     
    321321    );
    322322
    323     function start_lvl( &$output, $depth = 0, $args = array() ) {
     323    public function start_lvl( &$output, $depth = 0, $args = array() ) {
    324324        $output .= '<ul>';
    325325    }
    326326
    327     function end_lvl( &$output, $depth = 0, $args = array() ) {
     327    public function end_lvl( &$output, $depth = 0, $args = array() ) {
    328328        $output .= '</ul>';
    329329    }
    330330
    331     function start_el( &$output, $item, $depth = 0, $args = array(), $current_page = 0 ) {
     331    public function start_el( &$output, $item, $depth = 0, $args = array(), $current_page = 0 ) {
    332332        $output .= '<li>' . $item->id;
    333333    }
    334334
    335     function end_el( &$output, $page, $depth = 0, $args = array() ) {
     335    public function end_el( &$output, $page, $depth = 0, $args = array() ) {
    336336        $output .= '</li>';
    337337    }
Note: See TracChangeset for help on using the changeset viewer.