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/http/functions.php

    r51415 r52010  
    1010         * @covers ::wp_remote_head
    1111         */
    12         function test_head_request() {
     12        public function test_head_request() {
    1313                // This URL gives a direct 200 response.
    1414                $url      = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
    … …  
    2929         * @covers ::wp_remote_head
    3030         */
    31         function test_head_redirect() {
     31        public function test_head_redirect() {
    3232                // This URL will 301 redirect.
    3333                $url      = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';
    … …  
    4141         * @covers ::wp_remote_head
    4242         */
    43         function test_head_404() {
     43        public function test_head_404() {
    4444                $url      = 'https://asdftestblog1.files.wordpress.com/2007/09/awefasdfawef.jpg';
    4545                $response = wp_remote_head( $url );
    … …  
    5454         * @covers ::wp_remote_retrieve_response_code
    5555         */
    56         function test_get_request() {
     56        public function test_get_request() {
    5757                $url = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
    5858
    … …  
    7676         * @covers ::wp_remote_retrieve_response_code
    7777         */
    78         function test_get_redirect() {
     78        public function test_get_redirect() {
    7979                // This will redirect to asdftestblog1.files.wordpress.com.
    8080                $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';
    … …  
    9595         * @covers ::wp_remote_get
    9696         */
    97         function test_get_redirect_limit_exceeded() {
     97        public function test_get_redirect_limit_exceeded() {
    9898                // This will redirect to asdftestblog1.files.wordpress.com.
    9999                $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';
    … …  
    114114         * @covers ::wp_remote_retrieve_cookie_value
    115115         */
    116         function test_get_response_cookies() {
     116        public function test_get_response_cookies() {
    117117                $url = 'https://login.wordpress.org/wp-login.php';
    118118
    … …  
    147147         * @covers ::wp_remote_retrieve_cookie
    148148         */
    149         function test_get_response_cookies_with_wp_http_cookie_object() {
     149        public function test_get_response_cookies_with_wp_http_cookie_object() {
    150150                $url = 'http://example.org';
    151151
    … …  
    183183         * @covers ::wp_remote_retrieve_cookie
    184184         */
    185         function test_get_response_cookies_with_name_value_array() {
     185        public function test_get_response_cookies_with_name_value_array() {
    186186                $url = 'http://example.org';
    187187
    … …  
    215215         * @covers WP_Http
    216216         */
    217         function test_get_cookie_host_only() {
     217        public function test_get_cookie_host_only() {
    218218                // Emulate WP_Http::request() internals.
    219219                $requests_response = new Requests_Response();
Note: See TracChangeset for help on using the changeset viewer.