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/term/wpGenerateTagCloud.php

    r51968 r52010  
    2727     * @param $args     Options for `wp_generate_tag_cloud()`.
    2828     */
    29     function test_empty_tags_list_returned( $expected, $args ) {
     29    public function test_empty_tags_list_returned( $expected, $args ) {
    3030        $term_ids    = self::factory()->term->create_many( 4, array( 'taxonomy' => 'post_tag' ) );
    3131        $this->terms = array();
     
    4242     * @return array
    4343     */
    44     function empty_tags_data_provider() {
     44    public function empty_tags_data_provider() {
    4545        return array(
    4646            // When 'format' => 'array', we should be getting an empty array back.
     
    6666    }
    6767
    68     function test_hide_empty_false() {
     68    public function test_hide_empty_false() {
    6969        $term_id = self::factory()->tag->create();
    7070        $term    = get_term( $term_id, 'post_tag' );
     
    8787    }
    8888
    89     function test_hide_empty_false_format_array() {
     89    public function test_hide_empty_false_format_array() {
    9090        $term_id = self::factory()->tag->create();
    9191        $term    = get_term( $term_id, 'post_tag' );
     
    111111    }
    112112
    113     function test_hide_empty_false_format_list() {
     113    public function test_hide_empty_false_format_list() {
    114114        $term_id = self::factory()->tag->create();
    115115        $term    = get_term( $term_id, 'post_tag' );
     
    135135    }
    136136
    137     function test_hide_empty_false_multi() {
     137    public function test_hide_empty_false_multi() {
    138138        $term_ids = self::factory()->tag->create_many( 4 );
    139139        $terms    = array();
     
    162162    }
    163163
    164     function test_hide_empty_false_multi_format_list() {
     164    public function test_hide_empty_false_multi_format_list() {
    165165        $term_ids = self::factory()->tag->create_many( 4 );
    166166        $terms    = array();
Note: See TracChangeset for help on using the changeset viewer.