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

    r51587 r52010  
    1313    }
    1414
    15     function test_get_oembed_response_data_non_existent_post() {
     15    public function test_get_oembed_response_data_non_existent_post() {
    1616        $this->assertFalse( get_oembed_response_data( 0, 100 ) );
    1717    }
    1818
    19     function test_get_oembed_response_data() {
     19    public function test_get_oembed_response_data() {
    2020        $post = self::factory()->post->create_and_get(
    2121            array(
     
    4646     * Test get_oembed_response_data with an author.
    4747     */
    48     function test_get_oembed_response_data_author() {
     48    public function test_get_oembed_response_data_author() {
    4949        $user_id = self::factory()->user->create(
    5050            array(
     
    7979    }
    8080
    81     function test_get_oembed_response_link() {
     81    public function test_get_oembed_response_link() {
    8282        remove_filter( 'oembed_response_data', 'get_oembed_response_data_rich' );
    8383
     
    106106    }
    107107
    108     function test_get_oembed_response_data_with_draft_post() {
     108    public function test_get_oembed_response_data_with_draft_post() {
    109109        $post = self::factory()->post->create_and_get(
    110110            array(
     
    116116    }
    117117
    118     function test_get_oembed_response_data_with_scheduled_post() {
     118    public function test_get_oembed_response_data_with_scheduled_post() {
    119119        $post = self::factory()->post->create_and_get(
    120120            array(
     
    127127    }
    128128
    129     function test_get_oembed_response_data_with_private_post() {
     129    public function test_get_oembed_response_data_with_private_post() {
    130130        $post = self::factory()->post->create_and_get(
    131131            array(
     
    140140     * @ticket 47574
    141141     */
    142     function test_get_oembed_response_data_with_public_true_custom_post_status() {
     142    public function test_get_oembed_response_data_with_public_true_custom_post_status() {
    143143        // Custom status with 'public' => true.
    144144        register_post_status( 'public', array( 'public' => true ) );
     
    156156     * @ticket 47574
    157157     */
    158     function test_get_oembed_response_data_with_public_false_custom_post_status() {
     158    public function test_get_oembed_response_data_with_public_false_custom_post_status() {
    159159        // Custom status with 'public' => false.
    160160        register_post_status( 'private_foo', array( 'public' => false ) );
     
    172172     * @ticket 47574
    173173     */
    174     function test_get_oembed_response_data_with_unregistered_custom_post_status() {
     174    public function test_get_oembed_response_data_with_unregistered_custom_post_status() {
    175175        $post = self::factory()->post->create_and_get(
    176176            array(
     
    182182    }
    183183
    184     function test_get_oembed_response_data_maxwidth_too_high() {
     184    public function test_get_oembed_response_data_maxwidth_too_high() {
    185185        $post = self::factory()->post->create_and_get();
    186186
     
    191191    }
    192192
    193     function test_get_oembed_response_data_maxwidth_too_low() {
     193    public function test_get_oembed_response_data_maxwidth_too_low() {
    194194        $post = self::factory()->post->create_and_get();
    195195
     
    200200    }
    201201
    202     function test_get_oembed_response_data_maxwidth_invalid() {
     202    public function test_get_oembed_response_data_maxwidth_invalid() {
    203203        $post = self::factory()->post->create_and_get();
    204204
     
    214214    }
    215215
    216     function test_get_oembed_response_data_with_thumbnail() {
     216    public function test_get_oembed_response_data_with_thumbnail() {
    217217        $post          = self::factory()->post->create_and_get();
    218218        $file          = DIR_TESTDATA . '/images/canola.jpg';
     
    234234    }
    235235
    236     function test_get_oembed_response_data_for_attachment() {
     236    public function test_get_oembed_response_data_for_attachment() {
    237237        $parent = self::factory()->post->create();
    238238        $file   = DIR_TESTDATA . '/images/canola.jpg';
Note: See TracChangeset for help on using the changeset viewer.