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/post/objects.php

    r51404 r52010  
    66class Tests_Post_Objects extends WP_UnitTestCase {
    77
    8     function test_get_post() {
     8    public function test_get_post() {
    99        $id = self::factory()->post->create();
    1010
     
    6767    }
    6868
    69     function test_get_post_ancestors() {
     69    public function test_get_post_ancestors() {
    7070        $parent_id     = self::factory()->post->create();
    7171        $child_id      = self::factory()->post->create();
     
    102102     * @ticket 22882
    103103     */
    104     function test_get_post_ancestors_with_falsey_values() {
     104    public function test_get_post_ancestors_with_falsey_values() {
    105105        foreach ( array( null, 0, false, '0', '' ) as $post_id ) {
    106106            $this->assertIsArray( get_post_ancestors( $post_id ) );
     
    109109    }
    110110
    111     function test_get_post_category_property() {
     111    public function test_get_post_category_property() {
    112112        $post_id = self::factory()->post->create();
    113113        $post    = get_post( $post_id );
     
    128128    }
    129129
    130     function test_get_tags_input_property() {
     130    public function test_get_tags_input_property() {
    131131        $post_id = self::factory()->post->create();
    132132        $post    = get_post( $post_id );
     
    145145    }
    146146
    147     function test_get_page_template_property() {
     147    public function test_get_page_template_property() {
    148148        $post_id = self::factory()->post->create();
    149149        $post    = get_post( $post_id );
     
    158158    }
    159159
    160     function test_get_post_filter() {
     160    public function test_get_post_filter() {
    161161        $post = get_post(
    162162            self::factory()->post->create(
     
    201201    }
    202202
    203     function test_get_post_identity() {
     203    public function test_get_post_identity() {
    204204        $post = get_post( self::factory()->post->create() );
    205205
     
    210210    }
    211211
    212     function test_get_post_array() {
     212    public function test_get_post_array() {
    213213        $id = self::factory()->post->create();
    214214
     
    223223     * @ticket 22223
    224224     */
    225     function test_get_post_cache() {
     225    public function test_get_post_cache() {
    226226        global $wpdb;
    227227
Note: See TracChangeset for help on using the changeset viewer.