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/formatting/wpRicheditPre.php

    r51623 r52010  
    77class Tests_Formatting_wpRicheditPre extends WP_UnitTestCase {
    88
    9     function _charset_iso_8859_1() {
     9    public function charset_iso_8859_1() {
    1010        return 'iso-8859-1';
    1111    }
     
    1515     * @ticket 23688
    1616     */
    17     function test_wp_richedit_pre_charset_iso_8859_1() {
    18         add_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
     17    public function test_wp_richedit_pre_charset_iso_8859_1() {
     18        add_filter( 'pre_option_blog_charset', array( $this, 'charset_iso_8859_1' ) );
    1919        $iso8859_1 = 'Fran' . chr( 135 ) . 'ais';
    2020        $this->assertSame( '<p>' . $iso8859_1 . "</p>\n", wp_richedit_pre( $iso8859_1 ) );
    21         remove_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
     21        remove_filter( 'pre_option_blog_charset', array( $this, 'charset_iso_8859_1' ) );
    2222    }
    2323
    24     function _charset_utf_8() {
     24    public function charset_utf_8() {
    2525        return 'UTF-8';
    2626    }
     
    2929     * @ticket 23688
    3030     */
    31     function test_wp_richedit_pre_charset_utf_8() {
    32         add_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
     31    public function test_wp_richedit_pre_charset_utf_8() {
     32        add_filter( 'pre_option_blog_charset', array( $this, 'charset_utf_8' ) );
    3333        $utf8 = 'Fran' . chr( 195 ) . chr( 167 ) . 'ais';
    3434        $this->assertSame( '<p>' . $utf8 . "</p>\n", wp_richedit_pre( $utf8 ) );
    35         remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
     35        remove_filter( 'pre_option_blog_charset', array( $this, 'charset_utf_8' ) );
    3636    }
    3737}
Note: See TracChangeset for help on using the changeset viewer.