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

    r51568 r52010  
    77    protected $shortcodes = array( 'test-shortcode-tag', 'footag', 'bartag', 'baztag', 'dumptag', 'hyphen', 'hyphen-foo', 'hyphen-foo-bar', 'url', 'img' );
    88
    9     function set_up() {
     9    public function set_up() {
    1010        parent::set_up();
    1111
    1212        foreach ( $this->shortcodes as $shortcode ) {
    13             add_shortcode( $shortcode, array( $this, '_shortcode_' . str_replace( '-', '_', $shortcode ) ) );
     13            add_shortcode( $shortcode, array( $this, 'shortcode_' . str_replace( '-', '_', $shortcode ) ) );
    1414        }
    1515
     
    2020    }
    2121
    22     function tear_down() {
     22    public function tear_down() {
    2323        global $shortcode_tags;
    2424        foreach ( $this->shortcodes as $shortcode ) {
     
    2828    }
    2929
    30     function _shortcode_test_shortcode_tag( $atts, $content = null, $tagname = null ) {
     30    public function shortcode_test_shortcode_tag( $atts, $content = null, $tagname = null ) {
    3131        $this->atts              = $atts;
    3232        $this->content           = $content;
     
    3838
    3939    // [footag foo="bar"]
    40     function _shortcode_footag( $atts ) {
     40    public function shortcode_footag( $atts ) {
    4141        $foo = isset( $atts['foo'] ) ? $atts['foo'] : '';
    4242        return "foo = $foo";
     
    4444
    4545    // [bartag foo="bar"]
    46     function _shortcode_bartag( $atts ) {
     46    public function shortcode_bartag( $atts ) {
    4747        $processed_atts = shortcode_atts(
    4848            array(
     
    5858
    5959    // [baztag]content[/baztag]
    60     function _shortcode_baztag( $atts, $content = '' ) {
     60    public function shortcode_baztag( $atts, $content = '' ) {
    6161        return 'content = ' . do_shortcode( $content );
    6262    }
    6363
    64     function _shortcode_dumptag( $atts ) {
     64    public function shortcode_dumptag( $atts ) {
    6565        $out = '';
    6666        foreach ( $atts as $k => $v ) {
     
    7070    }
    7171
    72     function _shortcode_hyphen() {
     72    public function shortcode_hyphen() {
    7373        return __FUNCTION__;
    7474    }
    7575
    76     function _shortcode_hyphen_foo() {
     76    public function shortcode_hyphen_foo() {
    7777        return __FUNCTION__;
    7878    }
    7979
    80     function _shortcode_hyphen_foo_bar() {
     80    public function shortcode_hyphen_foo_bar() {
    8181        return __FUNCTION__;
    8282    }
    8383
    84     function _shortcode_url() {
     84    public function shortcode_url() {
    8585        return 'http://www.wordpress.org/';
    8686    }
    8787
    88     function _shortcode_img( $atts ) {
     88    public function shortcode_img( $atts ) {
    8989        $out = '<img';
    9090        foreach ( $atts as $k => $v ) {
     
    9696    }
    9797
    98     function test_noatts() {
     98    public function test_noatts() {
    9999        do_shortcode( '[test-shortcode-tag /]' );
    100100        $this->assertSame( '', $this->atts );
     
    102102    }
    103103
    104     function test_one_att() {
     104    public function test_one_att() {
    105105        do_shortcode( '[test-shortcode-tag foo="asdf" /]' );
    106106        $this->assertSame( array( 'foo' => 'asdf' ), $this->atts );
     
    108108    }
    109109
    110     function test_not_a_tag() {
     110    public function test_not_a_tag() {
    111111        $out = do_shortcode( '[not-a-shortcode-tag]' );
    112112        $this->assertSame( '[not-a-shortcode-tag]', $out );
     
    116116     * @ticket 17657
    117117     */
    118     function test_tag_hyphen_not_tag() {
     118    public function test_tag_hyphen_not_tag() {
    119119        $out = do_shortcode( '[dumptag-notreal]' );
    120120        $this->assertSame( '[dumptag-notreal]', $out );
    121121    }
    122122
    123     function test_tag_underscore_not_tag() {
     123    public function test_tag_underscore_not_tag() {
    124124        $out = do_shortcode( '[dumptag_notreal]' );
    125125        $this->assertSame( '[dumptag_notreal]', $out );
    126126    }
    127127
    128     function test_tag_not_tag() {
     128    public function test_tag_not_tag() {
    129129        $out = do_shortcode( '[dumptagnotreal]' );
    130130        $this->assertSame( '[dumptagnotreal]', $out );
     
    134134     * @ticket 17657
    135135     */
    136     function test_tag_hyphen() {
    137         $this->assertSame( '_shortcode_hyphen', do_shortcode( '[hyphen]' ) );
    138         $this->assertSame( '_shortcode_hyphen_foo', do_shortcode( '[hyphen-foo]' ) );
    139         $this->assertSame( '_shortcode_hyphen_foo_bar', do_shortcode( '[hyphen-foo-bar]' ) );
     136    public function test_tag_hyphen() {
     137        $this->assertSame( 'shortcode_hyphen', do_shortcode( '[hyphen]' ) );
     138        $this->assertSame( 'shortcode_hyphen_foo', do_shortcode( '[hyphen-foo]' ) );
     139        $this->assertSame( 'shortcode_hyphen_foo_bar', do_shortcode( '[hyphen-foo-bar]' ) );
    140140        $this->assertSame( '[hyphen-baz]', do_shortcode( '[hyphen-baz]' ) );
    141141        $this->assertSame( '[hyphen-foo-bar-baz]', do_shortcode( '[hyphen-foo-bar-baz]' ) );
     
    145145     * @ticket 9405
    146146     */
    147     function test_attr_hyphen() {
     147    public function test_attr_hyphen() {
    148148        do_shortcode( '[test-shortcode-tag foo="foo" foo-bar="foo-bar" foo-bar-="foo-bar-" -foo-bar="-foo-bar" -foo-bar-="-foo-bar-" foo-bar-baz="foo-bar-baz" -foo-bar-baz="-foo-bar-baz" foo--bar="foo--bar" /]' );
    149149        $expected_attrs = array(
     
    160160    }
    161161
    162     function test_two_atts() {
     162    public function test_two_atts() {
    163163        do_shortcode( '[test-shortcode-tag foo="asdf" bar="bing" /]' );
    164164        $this->assertSame(
     
    172172    }
    173173
    174     function test_noatts_enclosing() {
     174    public function test_noatts_enclosing() {
    175175        do_shortcode( '[test-shortcode-tag]content[/test-shortcode-tag]' );
    176176        $this->assertSame( '', $this->atts );
     
    179179    }
    180180
    181     function test_one_att_enclosing() {
     181    public function test_one_att_enclosing() {
    182182        do_shortcode( '[test-shortcode-tag foo="bar"]content[/test-shortcode-tag]' );
    183183        $this->assertSame( array( 'foo' => 'bar' ), $this->atts );
     
    186186    }
    187187
    188     function test_two_atts_enclosing() {
     188    public function test_two_atts_enclosing() {
    189189        do_shortcode( '[test-shortcode-tag foo="bar" baz="bing"]content[/test-shortcode-tag]' );
    190190        $this->assertSame(
     
    199199    }
    200200
    201     function test_unclosed() {
     201    public function test_unclosed() {
    202202        $out = do_shortcode( '[test-shortcode-tag]' );
    203203        $this->assertSame( '', $out );
     
    206206    }
    207207
    208     function test_positional_atts_num() {
     208    public function test_positional_atts_num() {
    209209        $out = do_shortcode( '[test-shortcode-tag 123]' );
    210210        $this->assertSame( '', $out );
     
    213213    }
    214214
    215     function test_positional_atts_url() {
     215    public function test_positional_atts_url() {
    216216        $out = do_shortcode( '[test-shortcode-tag https://www.youtube.com/watch?v=72xdCU__XCk]' );
    217217        $this->assertSame( '', $out );
     
    220220    }
    221221
    222     function test_positional_atts_quotes() {
     222    public function test_positional_atts_quotes() {
    223223        $out = do_shortcode( '[test-shortcode-tag "something in quotes" "something else"]' );
    224224        $this->assertSame( '', $out );
     
    233233    }
    234234
    235     function test_positional_atts_mixed() {
     235    public function test_positional_atts_mixed() {
    236236        $out = do_shortcode( '[test-shortcode-tag 123 https://wordpress.org/ 0 "foo" bar]' );
    237237        $this->assertSame( '', $out );
     
    249249    }
    250250
    251     function test_positional_and_named_atts() {
     251    public function test_positional_and_named_atts() {
    252252        $out = do_shortcode( '[test-shortcode-tag 123 url=https://wordpress.org/ foo bar="baz"]' );
    253253        $this->assertSame( '', $out );
     
    264264    }
    265265
    266     function test_footag_default() {
     266    public function test_footag_default() {
    267267        $out = do_shortcode( '[footag]' );
    268268        $this->assertSame( 'foo = ', $out );
    269269    }
    270270
    271     function test_footag_val() {
     271    public function test_footag_val() {
    272272        $val = rand_str();
    273273        $out = do_shortcode( '[footag foo="' . $val . '"]' );
     
    275275    }
    276276
    277     function test_nested_tags() {
     277    public function test_nested_tags() {
    278278        $out      = do_shortcode( '[baztag][dumptag abc="foo" def=123 https://wordpress.org/][/baztag]' );
    279279        $expected = "content = abc = foo\ndef = 123\n0 = https://wordpress.org\n";
     
    284284     * @ticket 6518
    285285     */
    286     function test_tag_escaped() {
     286    public function test_tag_escaped() {
    287287        $out = do_shortcode( '[[footag]] [[bartag foo="bar"]]' );
    288288        $this->assertSame( '[footag] [bartag foo="bar"]', $out );
     
    299299    }
    300300
    301     function test_tag_not_escaped() {
     301    public function test_tag_not_escaped() {
    302302        // These have square brackets on either end but aren't actually escaped.
    303303        $out = do_shortcode( '[[footag] [bartag foo="bar"]]' );
     
    317317    }
    318318
    319     function test_mixed_tags() {
     319    public function test_mixed_tags() {
    320320        $in       = <<<EOF
    321321So this is a post with [footag foo="some stuff"] and a bunch of tags.
     
    357357     * @ticket 6562
    358358     */
    359     function test_utf8_whitespace_1() {
     359    public function test_utf8_whitespace_1() {
    360360        // NO-BREAK SPACE: U+00A0.
    361361        do_shortcode( "[test-shortcode-tag foo=\"bar\" \xC2\xA0baz=\"123\"]" );
     
    373373     * @ticket 6562
    374374     */
    375     function test_utf8_whitespace_2() {
     375    public function test_utf8_whitespace_2() {
    376376        // ZERO WIDTH SPACE: U+200B.
    377377        do_shortcode( "[test-shortcode-tag foo=\"bar\" \xE2\x80\x8Babc=\"def\"]" );
     
    389389     * @ticket 14050
    390390     */
    391     function test_shortcode_unautop() {
     391    public function test_shortcode_unautop() {
    392392        // A blank line is added at the end, so test with it already there.
    393393        $test_string = "[footag]\n";
     
    395395    }
    396396
    397     function data_test_strip_shortcodes() {
     397    public function data_test_strip_shortcodes() {
    398398        return array(
    399399            array( 'before', 'before[gallery]' ),
     
    418418     * @param string $content   Content to run strip_shortcodes() on.
    419419     */
    420     function test_strip_shortcodes( $expected, $content ) {
     420    public function test_strip_shortcodes( $expected, $content ) {
    421421        $this->assertSame( $expected, strip_shortcodes( $content ) );
    422422    }
     
    425425     * @ticket 37767
    426426     */
    427     function test_strip_shortcodes_filter() {
    428         add_filter( 'strip_shortcodes_tagnames', array( $this, '_filter_strip_shortcodes_tagnames' ) );
     427    public function test_strip_shortcodes_filter() {
     428        add_filter( 'strip_shortcodes_tagnames', array( $this, 'filter_strip_shortcodes_tagnames' ) );
    429429        $this->assertSame( 'beforemiddle [footag]after', strip_shortcodes( 'before[gallery]middle [footag]after' ) );
    430         remove_filter( 'strip_shortcodes_tagnames', array( $this, '_filter_strip_shortcodes_tagnames' ) );
    431     }
    432 
    433     function _filter_strip_shortcodes_tagnames() {
     430        remove_filter( 'strip_shortcodes_tagnames', array( $this, 'filter_strip_shortcodes_tagnames' ) );
     431    }
     432
     433    public function filter_strip_shortcodes_tagnames() {
    434434        return array( 'gallery' );
    435435    }
    436436
    437437    // Store passed in shortcode_atts_{$shortcode} args.
    438     function _filter_atts( $out, $pairs, $atts ) {
     438    public function filter_atts( $out, $pairs, $atts ) {
    439439        $this->filter_atts_out   = $out;
    440440        $this->filter_atts_pairs = $pairs;
     
    444444
    445445    // Filter shortcode atts in various ways.
    446     function _filter_atts2( $out, $pairs, $atts ) {
     446    public function filter_atts2( $out, $pairs, $atts ) {
    447447        // If foo attribute equals "foo1", change it to be default value.
    448448        if ( isset( $out['foo'] ) && 'foo1' === $out['foo'] ) {
     
    459459    }
    460460
    461     function test_shortcode_atts_filter_passes_original_arguments() {
    462         add_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts' ), 10, 3 );
     461    public function test_shortcode_atts_filter_passes_original_arguments() {
     462        add_filter( 'shortcode_atts_bartag', array( $this, 'filter_atts' ), 10, 3 );
    463463
    464464        do_shortcode( '[bartag foo="foo1" /]' );
     
    479479        $this->assertSame( array( 'foo' => 'foo1' ), $this->filter_atts_atts );
    480480
    481         remove_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts' ), 10, 3 );
    482     }
    483 
    484     function test_shortcode_atts_filtering() {
    485         add_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts2' ), 10, 3 );
     481        remove_filter( 'shortcode_atts_bartag', array( $this, 'filter_atts' ), 10, 3 );
     482    }
     483
     484    public function test_shortcode_atts_filtering() {
     485        add_filter( 'shortcode_atts_bartag', array( $this, 'filter_atts2' ), 10, 3 );
    486486
    487487        $out = do_shortcode( '[bartag foo="foo1" baz="baz1" /]' );
     
    492492        $this->assertSame( 'foo = foo2', $out );
    493493
    494         remove_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts2' ), 10, 3 );
     494        remove_filter( 'shortcode_atts_bartag', array( $this, 'filter_atts2' ), 10, 3 );
    495495    }
    496496
     
    500500     * @ticket 22692
    501501     */
    502     function test_spaces_around_shortcodes() {
     502    public function test_spaces_around_shortcodes() {
    503503        $nbsp = "\xC2\xA0";
    504504
     
    522522     * @dataProvider data_escaping
    523523     */
    524     function test_escaping( $input, $output ) {
     524    public function test_escaping( $input, $output ) {
    525525        return $this->assertSame( $output, do_shortcode( $input ) );
    526526    }
    527527
    528     function data_escaping() {
     528    public function data_escaping() {
    529529        return array(
    530530            array(
     
    600600     * @dataProvider data_escaping2
    601601     */
    602     function test_escaping2( $input, $output ) {
     602    public function test_escaping2( $input, $output ) {
    603603        return $this->assertSame( $output, strip_shortcodes( $input ) );
    604604    }
    605605
    606     function data_escaping2() {
     606    public function data_escaping2() {
    607607        return array(
    608608            array(
     
    640640     * @ticket 26343
    641641     */
    642     function test_has_shortcode() {
     642    public function test_has_shortcode() {
    643643        $content = 'This is a blob with [gallery] in it';
    644644        $this->assertTrue( has_shortcode( $content, 'gallery' ) );
     
    656656     * @expectedIncorrectUsage add_shortcode
    657657     */
    658     function test_registration_bad( $input, $expected ) {
    659         return $this->sub_registration( $input, $expected );
     658    public function test_registration_bad( $input, $expected ) {
     659        $this->sub_registration( $input, $expected );
    660660    }
    661661
     
    665665     * @dataProvider data_registration_good
    666666     */
    667     function test_registration_good( $input, $expected ) {
    668         return $this->sub_registration( $input, $expected );
    669     }
    670 
    671     function sub_registration( $input, $expected ) {
     667    public function test_registration_good( $input, $expected ) {
     668        $this->sub_registration( $input, $expected );
     669    }
     670
     671    private function sub_registration( $input, $expected ) {
    672672        add_shortcode( $input, '' );
    673673        $actual = shortcode_exists( $input );
    674         $test   = $this->assertSame( $expected, $actual );
     674        $this->assertSame( $expected, $actual );
    675675        if ( $actual ) {
    676676            remove_shortcode( $input );
    677677        }
    678         return $test;
    679     }
    680 
    681     function data_registration_bad() {
     678    }
     679
     680    public function data_registration_bad() {
    682681        return array(
    683682            array(
     
    712711    }
    713712
    714     function data_registration_good() {
     713    public function data_registration_good() {
    715714        return array(
    716715            array(
     
    734733     * @dataProvider data_whole_posts
    735734     */
    736     function test_pcre_performance( $input ) {
     735    public function test_pcre_performance( $input ) {
    737736        $regex  = '/' . get_shortcode_regex() . '/';
    738737        $result = benchmark_pcre_backtracking( $regex, $input, 'match_all' );
     
    740739    }
    741740
    742     function data_whole_posts() {
     741    public function data_whole_posts() {
    743742        require_once DIR_TESTDATA . '/formatting/whole-posts.php';
    744743        return data_whole_posts();
     
    751750     * @ticket 51734
    752751     */
    753     function test_php_and_js_shortcode_attribute_regexes_match() {
     752    public function test_php_and_js_shortcode_attribute_regexes_match() {
    754753        // This test uses the source file by default but will use the built file if it exists.
    755754        // This allows the test to run using either the src or build directory.
     
    781780     * Test the (not recommended) [shortcode=XXX] format
    782781     */
    783     function test_unnamed_attribute() {
     782    public function test_unnamed_attribute() {
    784783        $out      = do_shortcode( '[dumptag=https://wordpress.org/]' );
    785784        $expected = "0 = =https://wordpress.org\n";
     
    790789     * @ticket 36306
    791790     */
    792     function test_smilies_arent_converted() {
     791    public function test_smilies_arent_converted() {
    793792        $out      = apply_filters( 'the_content', '[img alt="Hello :-) World"]' );
    794793        $expected = "<img alt=\"Hello :-) World\" />\n";
     
    802801        // Does nothing if no filters are set up.
    803802        $str = 'pre_do_shortcode_tag';
    804         add_shortcode( $str, array( $this, '_shortcode_pre_do_shortcode_tag' ) );
     803        add_shortcode( $str, array( $this, 'shortcode_pre_do_shortcode_tag' ) );
    805804        $result_nofilter = do_shortcode( "[{$str}]" );
    806805        $this->assertSame( 'foo', $result_nofilter );
    807806
    808807        // Short-circuit with filter.
    809         add_filter( 'pre_do_shortcode_tag', array( $this, '_filter_pre_do_shortcode_tag_bar' ) );
     808        add_filter( 'pre_do_shortcode_tag', array( $this, 'filter_pre_do_shortcode_tag_bar' ) );
    810809        $result_filter = do_shortcode( "[{$str}]" );
    811810        $this->assertSame( 'bar', $result_filter );
    812811
    813812        // Respect priority.
    814         add_filter( 'pre_do_shortcode_tag', array( $this, '_filter_pre_do_shortcode_tag_p11' ), 11 );
     813        add_filter( 'pre_do_shortcode_tag', array( $this, 'filter_pre_do_shortcode_tag_p11' ), 11 );
    815814        $result_priority = do_shortcode( "[{$str}]" );
    816815        $this->assertSame( 'p11', $result_priority );
     
    834833            ),
    835834        );
    836         add_filter( 'pre_do_shortcode_tag', array( $this, '_filter_pre_do_shortcode_tag_attr' ), 12, 4 );
     835        add_filter( 'pre_do_shortcode_tag', array( $this, 'filter_pre_do_shortcode_tag_attr' ), 12, 4 );
    837836        $result_atts = do_shortcode( "[{$str} a='b' c='d']" );
    838837        $this->assertSame( wp_json_encode( $arr ), $result_atts );
    839838
    840         remove_filter( 'pre_do_shortcode_tag', array( $this, '_filter_pre_do_shortcode_tag_attr' ), 12, 4 );
    841         remove_filter( 'pre_do_shortcode_tag', array( $this, '_filter_pre_do_shortcode_tag_p11' ), 11 );
    842         remove_filter( 'pre_do_shortcode_tag', array( $this, '_filter_pre_do_shortcode_tag_bar' ) );
     839        remove_filter( 'pre_do_shortcode_tag', array( $this, 'filter_pre_do_shortcode_tag_attr' ), 12, 4 );
     840        remove_filter( 'pre_do_shortcode_tag', array( $this, 'filter_pre_do_shortcode_tag_p11' ), 11 );
     841        remove_filter( 'pre_do_shortcode_tag', array( $this, 'filter_pre_do_shortcode_tag_bar' ) );
    843842        remove_shortcode( $str );
    844843    }
    845844
    846     public function _shortcode_pre_do_shortcode_tag( $atts = array(), $content = '' ) {
     845    public function shortcode_pre_do_shortcode_tag( $atts = array(), $content = '' ) {
    847846        return 'foo';
    848847    }
    849848
    850     public function _filter_pre_do_shortcode_tag_bar() {
     849    public function filter_pre_do_shortcode_tag_bar() {
    851850        return 'bar';
    852851    }
    853852
    854     public function _filter_pre_do_shortcode_tag_p11() {
     853    public function filter_pre_do_shortcode_tag_p11() {
    855854        return 'p11';
    856855    }
    857856
    858     public function _filter_pre_do_shortcode_tag_attr( $return, $key, $atts, $m ) {
     857    public function filter_pre_do_shortcode_tag_attr( $return, $key, $atts, $m ) {
    859858        $arr = array(
    860859            'return' => $return,
     
    872871        // Does nothing if no filters are set up.
    873872        $str = 'do_shortcode_tag';
    874         add_shortcode( $str, array( $this, '_shortcode_do_shortcode_tag' ) );
     873        add_shortcode( $str, array( $this, 'shortcode_do_shortcode_tag' ) );
    875874        $result_nofilter = do_shortcode( "[{$str}]" );
    876875        $this->assertSame( 'foo', $result_nofilter );
    877876
    878877        // Modify output with filter.
    879         add_filter( 'do_shortcode_tag', array( $this, '_filter_do_shortcode_tag_replace' ) );
     878        add_filter( 'do_shortcode_tag', array( $this, 'filter_do_shortcode_tag_replace' ) );
    880879        $result_filter = do_shortcode( "[{$str}]" );
    881880        $this->assertSame( 'fee', $result_filter );
    882881
    883882        // Respect priority.
    884         add_filter( 'do_shortcode_tag', array( $this, '_filter_do_shortcode_tag_generate' ), 11 );
     883        add_filter( 'do_shortcode_tag', array( $this, 'filter_do_shortcode_tag_generate' ), 11 );
    885884        $result_priority = do_shortcode( "[{$str}]" );
    886885        $this->assertSame( 'foobar', $result_priority );
     
    904903            ),
    905904        );
    906         add_filter( 'do_shortcode_tag', array( $this, '_filter_do_shortcode_tag_attr' ), 12, 4 );
     905        add_filter( 'do_shortcode_tag', array( $this, 'filter_do_shortcode_tag_attr' ), 12, 4 );
    907906        $result_atts = do_shortcode( "[{$str} a='b' c='d']" );
    908907        $this->assertSame( wp_json_encode( $arr ), $result_atts );
    909908
    910         remove_filter( 'do_shortcode_tag', array( $this, '_filter_do_shortcode_tag_attr' ), 12 );
    911         remove_filter( 'do_shortcode_tag', array( $this, '_filter_do_shortcode_tag_generate' ), 11 );
    912         remove_filter( 'do_shortcode_tag', array( $this, '_filter_do_shortcode_tag_replace' ) );
     909        remove_filter( 'do_shortcode_tag', array( $this, 'filter_do_shortcode_tag_attr' ), 12 );
     910        remove_filter( 'do_shortcode_tag', array( $this, 'filter_do_shortcode_tag_generate' ), 11 );
     911        remove_filter( 'do_shortcode_tag', array( $this, 'filter_do_shortcode_tag_replace' ) );
    913912        remove_shortcode( $str );
    914913    }
    915914
    916     public function _shortcode_do_shortcode_tag( $atts = array(), $content = '' ) {
     915    public function shortcode_do_shortcode_tag( $atts = array(), $content = '' ) {
    917916        return 'foo';
    918917    }
    919918
    920     public function _filter_do_shortcode_tag_replace( $return ) {
     919    public function filter_do_shortcode_tag_replace( $return ) {
    921920        return str_replace( 'oo', 'ee', $return );
    922921    }
    923922
    924     public function _filter_do_shortcode_tag_generate( $return ) {
     923    public function filter_do_shortcode_tag_generate( $return ) {
    925924        return 'foobar';
    926925    }
    927926
    928     public function _filter_do_shortcode_tag_attr( $return, $key, $atts, $m ) {
     927    public function filter_do_shortcode_tag_attr( $return, $key, $atts, $m ) {
    929928        $arr = array(
    930929            'return' => $return,
     
    941940     * Test 'value' syntax for empty attributes
    942941     */
    943     function test_empty_single_quote_attribute() {
     942    public function test_empty_single_quote_attribute() {
    944943        $out = do_shortcode( '[test-shortcode-tag a="foo" b=\'bar\' c=baz foo \'bar\' "baz" ]test empty atts[/test-shortcode-tag]' );
    945944        $this->assertSame(
     
    959958     * @ticket 37304
    960959     */
    961     function test_positional_atts_single_quotes() {
     960    public function test_positional_atts_single_quotes() {
    962961        $out = do_shortcode( "[test-shortcode-tag 'something in quotes' 'something else']" );
    963962        $this->assertSame( '', $out );
     
    975974     * @ticket 37304
    976975     */
    977     function test_positional_atts_mixed_quotes() {
     976    public function test_positional_atts_mixed_quotes() {
    978977        $out = do_shortcode( "[test-shortcode-tag 'something in quotes' \"something else\" 123 foo bar='baz' example=\"test\" ]" );
    979978        $this->assertSame( '', $out );
Note: See TracChangeset for help on using the changeset viewer.