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

    r51623 r52010  
    55 */
    66class Tests_Formatting_Slashit extends WP_UnitTestCase {
    7     function test_backslashes_middle_numbers() {
     7    public function test_backslashes_middle_numbers() {
    88        $this->assertSame( "\\a-!9\\a943\\b\\c", backslashit( 'a-!9a943bc' ) );
    99    }
    1010
    11     function test_backslashes_alphas() {
     11    public function test_backslashes_alphas() {
    1212        $this->assertSame( "\\a943\\b\\c", backslashit( 'a943bc' ) );
    1313    }
    1414
    15     function test_double_backslashes_leading_numbers() {
     15    public function test_double_backslashes_leading_numbers() {
    1616        $this->assertSame( '\\\\95', backslashit( '95' ) );
    1717    }
    1818
    19     function test_removes_trailing_slashes() {
     19    public function test_removes_trailing_slashes() {
    2020        $this->assertSame( 'a', untrailingslashit( 'a/' ) );
    2121        $this->assertSame( 'a', untrailingslashit( 'a////' ) );
     
    2525     * @ticket 22267
    2626     */
    27     function test_removes_trailing_backslashes() {
     27    public function test_removes_trailing_backslashes() {
    2828        $this->assertSame( 'a', untrailingslashit( 'a\\' ) );
    2929        $this->assertSame( 'a', untrailingslashit( 'a\\\\\\\\' ) );
     
    3333     * @ticket 22267
    3434     */
    35     function test_removes_trailing_mixed_slashes() {
     35    public function test_removes_trailing_mixed_slashes() {
    3636        $this->assertSame( 'a', untrailingslashit( 'a/\\' ) );
    3737        $this->assertSame( 'a', untrailingslashit( 'a\\/\\///\\\\//' ) );
    3838    }
    3939
    40     function test_adds_trailing_slash() {
     40    public function test_adds_trailing_slash() {
    4141        $this->assertSame( 'a/', trailingslashit( 'a' ) );
    4242    }
    4343
    44     function test_does_not_add_trailing_slash_if_one_exists() {
     44    public function test_does_not_add_trailing_slash_if_one_exists() {
    4545        $this->assertSame( 'a/', trailingslashit( 'a/' ) );
    4646    }
     
    4949     * @ticket 22267
    5050     */
    51     function test_converts_trailing_backslash_to_slash_if_one_exists() {
     51    public function test_converts_trailing_backslash_to_slash_if_one_exists() {
    5252        $this->assertSame( 'a/', trailingslashit( 'a\\' ) );
    5353    }
Note: See TracChangeset for help on using the changeset viewer.