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

    r51623 r52010  
    1212     * @dataProvider data
    1313     */
    14     function test_percent_encodes_non_reserved_characters( $utf8, $urlencoded ) {
     14    public function test_percent_encodes_non_reserved_characters( $utf8, $urlencoded ) {
    1515        $this->assertSame( $urlencoded, utf8_uri_encode( $utf8 ) );
    1616    }
     
    1919     * @dataProvider data
    2020     */
    21     function test_output_is_not_longer_than_optional_length_argument( $utf8, $unused_for_this_test ) {
     21    public function test_output_is_not_longer_than_optional_length_argument( $utf8, $unused_for_this_test ) {
    2222        $max_length = 30;
    2323        $this->assertTrue( strlen( utf8_uri_encode( $utf8, $max_length ) ) <= $max_length );
    2424    }
    2525
    26     function data() {
     26    public function data() {
    2727        $utf8_urls     = file( DIR_TESTDATA . '/formatting/utf-8/utf-8.txt' );
    2828        $urlencoded    = file( DIR_TESTDATA . '/formatting/utf-8/urlencoded.txt' );
Note: See TracChangeset for help on using the changeset viewer.