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/formatting/sanitizeUser.php

    r51623 r52010  
    55 */
    66class Tests_Formatting_SanitizeUser extends WP_UnitTestCase {
    7     function test_strips_html() {
     7    public function test_strips_html() {
    88        $input    = 'Captain <strong>Awesome</strong>';
    99        $expected = is_multisite() ? 'captain awesome' : 'Captain Awesome';
     
    3333    }
    3434
    35     function test_strips_percent_encoded_octets() {
     35    public function test_strips_percent_encoded_octets() {
    3636        $expected = is_multisite() ? 'franois' : 'Franois';
    3737        $this->assertSame( $expected, sanitize_user( 'Fran%c3%a7ois' ) );
    3838    }
    39     function test_optional_strict_mode_reduces_to_safe_ascii_subset() {
     39    public function test_optional_strict_mode_reduces_to_safe_ascii_subset() {
    4040        $this->assertSame( 'abc', sanitize_user( '()~ab~ˆcˆ!', true ) );
    4141    }
Note: See TracChangeset for help on using the changeset viewer.