Make WordPress Core


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

    r48937 r52010  
    55 */
    66class Tests_oEmbed_Discovery extends WP_UnitTestCase {
    7     function test_add_oembed_discovery_links_non_singular() {
     7    public function test_add_oembed_discovery_links_non_singular() {
    88        $this->assertSame( '', get_echo( 'wp_oembed_add_discovery_links' ) );
    99    }
    1010
    11     function test_add_oembed_discovery_links_front_page() {
     11    public function test_add_oembed_discovery_links_front_page() {
    1212        $this->go_to( home_url() );
    1313        $this->assertSame( '', get_echo( 'wp_oembed_add_discovery_links' ) );
     
    1818     * @ticket 34971
    1919     */
    20     function test_add_oembed_discovery_links_static_front_page() {
     20    public function test_add_oembed_discovery_links_static_front_page() {
    2121        update_option( 'show_on_front', 'page' );
    2222        update_option(
     
    4141    }
    4242
    43     function test_add_oembed_discovery_links_to_post() {
     43    public function test_add_oembed_discovery_links_to_post() {
    4444        $post_id = self::factory()->post->create();
    4545        $this->go_to( get_permalink( $post_id ) );
     
    5252    }
    5353
    54     function test_add_oembed_discovery_links_to_page() {
     54    public function test_add_oembed_discovery_links_to_page() {
    5555        $post_id = self::factory()->post->create(
    5656            array(
     
    6767    }
    6868
    69     function test_add_oembed_discovery_links_to_attachment() {
     69    public function test_add_oembed_discovery_links_to_attachment() {
    7070        $post_id       = self::factory()->post->create();
    7171        $file          = DIR_TESTDATA . '/images/canola.jpg';
Note: See TracChangeset for help on using the changeset viewer.