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

    r51404 r52010  
    4545    }
    4646
    47     function test_unique_postmeta() {
     47    public function test_unique_postmeta() {
    4848        // Add a unique post meta item.
    4949        $this->assertIsInt( add_post_meta( self::$post_id, 'unique', 'value', true ) );
     
    6868    }
    6969
    70     function test_nonunique_postmeta() {
     70    public function test_nonunique_postmeta() {
    7171        // Add two non-unique post meta items.
    7272        $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique', 'value' ) );
     
    105105    }
    106106
    107     function test_update_post_meta() {
     107    public function test_update_post_meta() {
    108108        // Add a unique post meta item.
    109109        $this->assertIsInt( add_post_meta( self::$post_id, 'unique_update', 'value', true ) );
     
    132132    }
    133133
    134     function test_delete_post_meta() {
     134    public function test_delete_post_meta() {
    135135        // Add two unique post meta items.
    136136        $this->assertIsInt( add_post_meta( self::$post_id, 'unique_delete', 'value', true ) );
     
    149149    }
    150150
    151     function test_delete_post_meta_by_key() {
     151    public function test_delete_post_meta_by_key() {
    152152        // Add two unique post meta items.
    153153        $this->assertIsInt( add_post_meta( self::$post_id, 'unique_delete_by_key', 'value', true ) );
     
    166166    }
    167167
    168     function test_get_post_meta_by_id() {
     168    public function test_get_post_meta_by_id() {
    169169        $mid = add_post_meta( self::$post_id, 'get_post_meta_by_key', 'get_post_meta_by_key_value', true );
    170170        $this->assertIsInt( $mid );
     
    186186    }
    187187
    188     function test_delete_meta() {
     188    public function test_delete_meta() {
    189189        $mid = add_post_meta( self::$post_id, 'delete_meta', 'delete_meta_value', true );
    190190        $this->assertIsInt( $mid );
     
    196196    }
    197197
    198     function test_update_meta() {
     198    public function test_update_meta() {
    199199        // Add a unique post meta item.
    200200        $mid1 = add_post_meta( self::$post_id, 'unique_update', 'value', true );
     
    234234     * @ticket 12860
    235235     */
    236     function test_funky_post_meta() {
     236    public function test_funky_post_meta() {
    237237        $classy          = new StdClass();
    238238        $classy->ID      = 1;
Note: See TracChangeset for help on using the changeset viewer.