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/oembed/controller.php

    r51568 r52010  
    176176    }
    177177
    178     function test_wp_oembed_ensure_format() {
     178    public function test_wp_oembed_ensure_format() {
    179179        $this->assertSame( 'json', wp_oembed_ensure_format( 'json' ) );
    180180        $this->assertSame( 'xml', wp_oembed_ensure_format( 'xml' ) );
     
    184184    }
    185185
    186     function test_oembed_create_xml() {
     186    public function test_oembed_create_xml() {
    187187        $actual = _oembed_create_xml(
    188188            array(
     
    261261    }
    262262
    263     function test_request_with_wrong_method() {
     263    public function test_request_with_wrong_method() {
    264264        $request = new WP_REST_Request( 'POST', '/oembed/1.0/embed' );
    265265
     
    270270    }
    271271
    272     function test_request_without_url_param() {
     272    public function test_request_without_url_param() {
    273273        $request = new WP_REST_Request( 'GET', '/oembed/1.0/embed' );
    274274
     
    280280    }
    281281
    282     function test_request_with_bad_url() {
     282    public function test_request_with_bad_url() {
    283283        $request = new WP_REST_Request( 'GET', '/oembed/1.0/embed' );
    284284        $request->set_param( 'url', 'http://google.com/' );
     
    290290    }
    291291
    292     function test_request_invalid_format() {
     292    public function test_request_invalid_format() {
    293293        $post_id = $this->factory()->post->create();
    294294
     
    304304    }
    305305
    306     function test_request_json() {
     306    public function test_request_json() {
    307307        $user = self::factory()->user->create_and_get(
    308308            array(
     
    349349     * @ticket 34971
    350350     */
    351     function test_request_static_front_page() {
     351    public function test_request_static_front_page() {
    352352        $post = self::factory()->post->create_and_get(
    353353            array(
     
    391391    }
    392392
    393     function test_request_xml() {
     393    public function test_request_xml() {
    394394        $user = self::factory()->user->create_and_get(
    395395            array(
     
    438438     * @group ms-required
    439439     */
    440     function test_request_ms_child_in_root_blog() {
     440    public function test_request_ms_child_in_root_blog() {
    441441        $child = self::factory()->blog->create();
    442442        switch_to_blog( $child );
     
    461461    }
    462462
    463     function test_rest_pre_serve_request() {
     463    public function test_rest_pre_serve_request() {
    464464        $user = $this->factory()->user->create_and_get(
    465465            array(
     
    485485    }
    486486
    487     function test_rest_pre_serve_request_wrong_format() {
     487    public function test_rest_pre_serve_request_wrong_format() {
    488488        $post = $this->factory()->post->create_and_get();
    489489
     
    497497    }
    498498
    499     function test_rest_pre_serve_request_wrong_method() {
     499    public function test_rest_pre_serve_request_wrong_method() {
    500500        $post = $this->factory()->post->create_and_get();
    501501
     
    509509    }
    510510
    511     function test_get_oembed_endpoint_url() {
     511    public function test_get_oembed_endpoint_url() {
    512512        $this->assertSame( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url() );
    513513        $this->assertSame( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url( '', 'json' ) );
     
    522522    }
    523523
    524     function test_get_oembed_endpoint_url_pretty_permalinks() {
     524    public function test_get_oembed_endpoint_url_pretty_permalinks() {
    525525        update_option( 'permalink_structure', '/%postname%' );
    526526
     
    675675     * @ticket 45142
    676676     */
    677     function test_proxy_with_internal_url() {
     677    public function test_proxy_with_internal_url() {
    678678        wp_set_current_user( self::$editor );
    679679
     
    723723     * @ticket 45142
    724724     */
    725     function test_proxy_with_static_front_page_url() {
     725    public function test_proxy_with_static_front_page_url() {
    726726        wp_set_current_user( self::$editor );
    727727
Note: See TracChangeset for help on using the changeset viewer.