Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (5 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/functions/allowedProtocols.php

    r49055 r52010  
    1111         * @ticket 19354
    1212         */
    13         function test_data_is_not_an_allowed_protocol() {
     13        public function test_data_is_not_an_allowed_protocol() {
    1414                $this->assertNotContains( 'data', wp_allowed_protocols() );
    1515        }
    1616
    17         function test_allowed_protocol_has_an_example() {
     17        public function test_allowed_protocol_has_an_example() {
    1818                $example_protocols = array();
    1919                foreach ( $this->data_example_urls() as $example ) {
     
    3030         * @param string Example URL.
    3131         */
    32         function test_allowed_protocols( $protocol, $url ) {
     32        public function test_allowed_protocols( $protocol, $url ) {
    3333                $this->assertSame( $url, esc_url( $url, $protocol ) );
    3434                $this->assertSame( $url, esc_url( $url, wp_allowed_protocols() ) );
     
    3838         * @link http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
    3939         */
    40         function data_example_urls() {
     40        public function data_example_urls() {
    4141                return array(
    4242                        array( 'http', 'http://example.com' ),                                 // RFC7230
Note: See TracChangeset for help on using the changeset viewer.