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/theme/support.php

    r49354 r52010  
    66class Tests_Theme_Support extends WP_UnitTestCase {
    77
    8     function test_the_basics() {
     8    public function test_the_basics() {
    99        add_theme_support( 'automatic-feed-links' );
    1010        $this->assertTrue( current_theme_supports( 'automatic-feed-links' ) );
     
    1515    }
    1616
    17     function test_admin_bar() {
     17    public function test_admin_bar() {
    1818        add_theme_support( 'admin-bar' );
    1919        $this->assertTrue( current_theme_supports( 'admin-bar' ) );
     
    7878     * @ticket 24932
    7979     */
    80     function test_supports_html5() {
     80    public function test_supports_html5() {
    8181        remove_theme_support( 'html5' );
    8282        $this->assertFalse( current_theme_supports( 'html5' ) );
     
    9595     * @expectedIncorrectUsage add_theme_support( 'html5' )
    9696     */
    97     function test_supports_html5_subset() {
     97    public function test_supports_html5_subset() {
    9898        remove_theme_support( 'html5' );
    9999        $this->assertFalse( current_theme_supports( 'html5' ) );
     
    126126     * @expectedIncorrectUsage add_theme_support( 'html5' )
    127127     */
    128     function test_supports_html5_invalid() {
     128    public function test_supports_html5_invalid() {
    129129        remove_theme_support( 'html5' );
    130130        $this->assertFalse( add_theme_support( 'html5', 'comment-form' ) );
     
    138138     * @expectedIncorrectUsage add_theme_support( 'post-formats' )
    139139     */
    140     function test_supports_post_formats_doing_it_wrong() {
     140    public function test_supports_post_formats_doing_it_wrong() {
    141141        // The second parameter should be an array.
    142142        $this->assertFalse( add_theme_support( 'post-formats' ) );
    143143    }
    144144
    145     function supports_foobar( $yesno, $args, $feature ) {
     145    public function supports_foobar( $yesno, $args, $feature ) {
    146146        if ( $args[0] === $feature[0] ) {
    147147            return true;
     
    150150    }
    151151
    152     function test_plugin_hook() {
     152    public function test_plugin_hook() {
    153153        $this->assertFalse( current_theme_supports( 'foobar' ) );
    154154        add_theme_support( 'foobar' );
     
    168168     * @ticket 26900
    169169     */
    170     function test_supports_menus() {
     170    public function test_supports_menus() {
    171171        // Start fresh.
    172172        foreach ( get_registered_nav_menus() as $location => $desc ) {
     
    198198     * @ticket 45125
    199199     */
    200     function test_responsive_embeds() {
     200    public function test_responsive_embeds() {
    201201        add_theme_support( 'responsive-embeds' );
    202202        $this->assertTrue( current_theme_supports( 'responsive-embeds' ) );
Note: See TracChangeset for help on using the changeset viewer.