Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (4 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/user/multisite.php

    r51869 r52010  
    1212    class Tests_Multisite_User extends WP_UnitTestCase {
    1313
    14         function test_remove_user_from_blog() {
     14        public function test_remove_user_from_blog() {
    1515            $user1 = self::factory()->user->create_and_get();
    1616            $user2 = self::factory()->user->create_and_get();
     
    2929         * Test the returned data from get_blogs_of_user()
    3030         */
    31         function test_get_blogs_of_user() {
     31        public function test_get_blogs_of_user() {
    3232            $user1_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
    3333
     
    9999         * @expectedDeprecated is_blog_user
    100100         */
    101         function test_is_blog_user() {
     101        public function test_is_blog_user() {
    102102            global $wpdb;
    103103
     
    120120        }
    121121
    122         function test_is_user_member_of_blog() {
     122        public function test_is_user_member_of_blog() {
    123123            global $wpdb;
    124124
     
    181181         * @ticket 23192
    182182         */
    183         function test_is_user_spammy() {
     183        public function test_is_user_spammy() {
    184184            $user_id = self::factory()->user->create(
    185185                array(
     
    210210         * @ticket 20601
    211211         */
    212         function test_user_member_of_blog() {
     212        public function test_user_member_of_blog() {
    213213            global $wp_rewrite;
    214214
     
    249249        }
    250250
    251         function test_revoked_super_admin_can_be_deleted() {
     251        public function test_revoked_super_admin_can_be_deleted() {
    252252            if ( isset( $GLOBALS['super_admins'] ) ) {
    253253                $old_global = $GLOBALS['super_admins'];
     
    266266        }
    267267
    268         function test_revoked_super_admin_is_deleted() {
     268        public function test_revoked_super_admin_is_deleted() {
    269269            if ( isset( $GLOBALS['super_admins'] ) ) {
    270270                $old_global = $GLOBALS['super_admins'];
     
    285285        }
    286286
    287         function test_super_admin_cannot_be_deleted() {
     287        public function test_super_admin_cannot_be_deleted() {
    288288            if ( isset( $GLOBALS['super_admins'] ) ) {
    289289                $old_global = $GLOBALS['super_admins'];
     
    304304         * @ticket 27205
    305305         */
    306         function test_granting_super_admins() {
     306        public function test_granting_super_admins() {
    307307            if ( isset( $GLOBALS['super_admins'] ) ) {
    308308                $old_global = $GLOBALS['super_admins'];
Note: See TracChangeset for help on using the changeset viewer.