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/option/multisite.php

    r51869 r52010  
    1212    class Tests_Multisite_Option extends WP_UnitTestCase {
    1313
    14         function test_from_same_site() {
     14        public function test_from_same_site() {
    1515            $key    = __FUNCTION__ . '_1';
    1616            $key2   = __FUNCTION__ . '_2';
     
    4949        }
    5050
    51         function test_from_same_site_with_null_blog_id() {
     51        public function test_from_same_site_with_null_blog_id() {
    5252            $key    = __FUNCTION__ . '_1';
    5353            $key2   = __FUNCTION__ . '_2';
     
    8585        }
    8686
    87         function test_with_another_site() {
     87        public function test_with_another_site() {
    8888            $user_id = self::factory()->user->create();
    8989            $this->assertIsInt( $user_id );
     
    135135         * @group multisite
    136136         */
    137         function test_site_notoptions() {
     137        public function test_site_notoptions() {
    138138            $network_id     = get_current_network_id();
    139139            $notoptions_key = "{$network_id}:notoptions";
     
    152152        }
    153153
    154         function test_users_can_register_signup_filter() {
     154        public function test_users_can_register_signup_filter() {
    155155
    156156            $registration = get_site_option( 'registration' );
     
    170170         * @dataProvider data_illegal_names
    171171         */
    172         function test_sanitize_network_option_illegal_names( $option_value, $sanitized_option_value ) {
     172        public function test_sanitize_network_option_illegal_names( $option_value, $sanitized_option_value ) {
    173173            update_site_option( 'illegal_names', $option_value );
    174174            $this->assertSame( $sanitized_option_value, get_site_option( 'illegal_names' ) );
    175175        }
    176176
    177         function data_illegal_names() {
     177        public function data_illegal_names() {
    178178            return array(
    179179                array( array( '', 'Woo', '' ), array( 'Woo' ) ),
     
    189189         * @param $sanitized_option_value
    190190         */
    191         function test_sanitize_network_option_limited_email_domains( $option_value, $sanitized_option_value ) {
     191        public function test_sanitize_network_option_limited_email_domains( $option_value, $sanitized_option_value ) {
    192192            update_site_option( 'limited_email_domains', $option_value );
    193193            $this->assertSame( $sanitized_option_value, get_site_option( 'limited_email_domains' ) );
     
    200200         * @param $sanitized_option_value
    201201         */
    202         function test_sanitize_network_option_banned_email_domains( $option_value, $sanitized_option_value ) {
     202        public function test_sanitize_network_option_banned_email_domains( $option_value, $sanitized_option_value ) {
    203203            update_site_option( 'banned_email_domains', $option_value );
    204204            $this->assertSame( $sanitized_option_value, get_site_option( 'banned_email_domains' ) );
    205205        }
    206206
    207         function data_email_domains() {
     207        public function data_email_domains() {
    208208            return array(
    209209                array( array( 'woo', '', 'boo.com', 'foo.net.biz..' ), array( 'woo', 'boo.com' ) ),
Note: See TracChangeset for help on using the changeset viewer.