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

    r51454 r52010  
    5050         * @ticket 5381
    5151         */
    52         function test_is_term_type() {
     52        public function test_is_term_type() {
    5353                // Insert a term.
    5454                $term = rand_str();
    … …  
    6565         * @ticket 15919
    6666         */
    67         function test_wp_count_terms() {
     67        public function test_wp_count_terms() {
    6868                $count = wp_count_terms(
    6969                        array(
    … …  
    7979         * @ticket 36399
    8080         */
    81         function test_wp_count_terms_legacy_interoperability() {
     81        public function test_wp_count_terms_legacy_interoperability() {
    8282                self::factory()->tag->create_many( 5 );
    8383
    … …  
    9797         * @ticket 15475
    9898         */
    99         function test_wp_add_remove_object_terms() {
     99        public function test_wp_add_remove_object_terms() {
    100100                $posts = self::$post_ids;
    101101                $tags  = self::factory()->tag->create_many( 5 );
    … …  
    128128         * @group category.php
    129129         */
    130         function test_term_is_ancestor_of() {
     130        public function test_term_is_ancestor_of() {
    131131                $term  = rand_str();
    132132                $term2 = rand_str();
    … …  
    147147        }
    148148
    149         function test_wp_insert_delete_category() {
     149        public function test_wp_insert_delete_category() {
    150150                $term = rand_str();
    151151                $this->assertNull( category_exists( $term ) );
    … …  
    173173         * @ticket 16550
    174174         */
    175         function test_wp_set_post_categories() {
     175        public function test_wp_set_post_categories() {
    176176                $post_id = self::$post_ids[0];
    177177                $post    = get_post( $post_id );
    … …  
    212212         * @ticket 43516
    213213         */
    214         function test_wp_set_post_categories_sets_default_category_for_custom_post_types() {
     214        public function test_wp_set_post_categories_sets_default_category_for_custom_post_types() {
    215215                add_filter( 'default_category_post_types', array( $this, 'filter_default_category_post_types' ) );
    216216
    … …  
    233233        }
    234234
    235         function filter_default_category_post_types( $post_types ) {
     235        public function filter_default_category_post_types( $post_types ) {
    236236                $post_types[] = 'cpt';
    237237                return $post_types;
    … …  
    241241         * @ticket 25852
    242242         */
    243         function test_sanitize_term_field() {
     243        public function test_sanitize_term_field() {
    244244                $term = wp_insert_term( 'foo', $this->taxonomy );
    245245
    … …  
    253253         * @ticket 19205
    254254         */
    255         function test_orphan_category() {
     255        public function test_orphan_category() {
    256256                $cat_id1 = self::factory()->category->create();
    257257
Note: See TracChangeset for help on using the changeset viewer.