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/user/mapMetaCap.php

    r49603 r52010  
    4242     * @ticket 13905
    4343     */
    44     function test_capability_type_post_with_invalid_id() {
     44    public function test_capability_type_post_with_invalid_id() {
    4545        $this->assertSame(
    4646            array( 'do_not_allow' ),
     
    4949    }
    5050
    51     function test_capability_type_post_with_no_extra_caps() {
     51    public function test_capability_type_post_with_no_extra_caps() {
    5252
    5353        register_post_type(
     
    8989    }
    9090
    91     function test_custom_capability_type_with_map_meta_cap() {
     91    public function test_custom_capability_type_with_map_meta_cap() {
    9292        register_post_type(
    9393            self::$post_type,
     
    128128    }
    129129
    130     function test_capability_type_post_with_one_renamed_cap() {
     130    public function test_capability_type_post_with_one_renamed_cap() {
    131131        register_post_type(
    132132            self::$post_type,
     
    169169    }
    170170
    171     function test_capability_type_post_map_meta_cap_true_with_renamed_cap() {
     171    public function test_capability_type_post_map_meta_cap_true_with_renamed_cap() {
    172172        register_post_type(
    173173            self::$post_type,
     
    214214    }
    215215
    216     function test_capability_type_post_with_all_meta_caps_renamed() {
     216    public function test_capability_type_post_with_all_meta_caps_renamed() {
    217217        register_post_type(
    218218            self::$post_type,
     
    259259    }
    260260
    261     function test_capability_type_post_with_all_meta_caps_renamed_mapped() {
     261    public function test_capability_type_post_with_all_meta_caps_renamed_mapped() {
    262262        register_post_type(
    263263            self::$post_type,
     
    308308     * @ticket 30991
    309309     */
    310     function test_delete_posts_cap_without_map_meta_cap() {
     310    public function test_delete_posts_cap_without_map_meta_cap() {
    311311        register_post_type(
    312312            self::$post_type,
     
    323323    }
    324324
    325     function test_unfiltered_html_cap() {
     325    public function test_unfiltered_html_cap() {
    326326        if ( defined( 'DISALLOW_UNFILTERED_HTML' ) ) {
    327327            $this->assertFalse( DISALLOW_UNFILTERED_HTML );
     
    339339     * @ticket 20488
    340340     */
    341     function test_file_edit_caps_not_reliant_on_unfiltered_html_constant() {
     341    public function test_file_edit_caps_not_reliant_on_unfiltered_html_constant() {
    342342        $this->assertFalse( defined( 'DISALLOW_FILE_MODS' ) );
    343343        $this->assertFalse( defined( 'DISALLOW_FILE_EDIT' ) );
     
    357357     * @ticket 27020
    358358     */
    359     function test_authorless_posts_capabilties() {
     359    public function test_authorless_posts_capabilties() {
    360360        $post_id = self::factory()->post->create(
    361361            array(
     
    377377     * @ticket 37580
    378378     */
    379     function test_only_users_who_can_manage_options_can_delete_page_on_front() {
     379    public function test_only_users_who_can_manage_options_can_delete_page_on_front() {
    380380        $post_id = self::factory()->post->create(
    381381            array(
     
    397397     * @ticket 37580
    398398     */
    399     function test_only_users_who_can_manage_options_can_delete_page_for_posts() {
     399    public function test_only_users_who_can_manage_options_can_delete_page_for_posts() {
    400400        $post_id = self::factory()->post->create(
    401401            array(
Note: See TracChangeset for help on using the changeset viewer.