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

    r51568 r52010  
    11<?php
     2/**
     3 * @group 123456
     4 */
    25class Tests_User_Settings extends WP_UnitTestCase {
    36    protected $user_id;
    47
    5     function set_up() {
     8    public function set_up() {
    69        parent::set_up();
    710
     
    1518    }
    1619
    17     function tear_down() {
     20    public function tear_down() {
    1821        unset( $GLOBALS['_updated_user_settings'] );
    1922
     
    2124    }
    2225
    23     function test_set_user_setting() {
     26    public function test_set_user_setting() {
    2427        $foo = get_user_setting( 'foo' );
    2528
     
    3134    }
    3235
    33     function test_set_user_setting_dashes() {
     36    public function test_set_user_setting_dashes() {
    3437        $foo = get_user_setting( 'foo' );
    3538
     
    4144    }
    4245
    43     function test_set_user_setting_strip_asterisks() {
     46    public function test_set_user_setting_strip_asterisks() {
    4447        $foo = get_user_setting( 'foo' );
    4548
     
    5255
    5356    // set_user_setting() bails if `headers_sent()` is true.
    54     function set_user_setting( $name, $value ) {
     57    private function set_user_setting( $name, $value ) {
    5558        $all_user_settings          = get_all_user_settings();
    5659        $all_user_settings[ $name ] = $value;
Note: See TracChangeset for help on using the changeset viewer.