Make WordPress Core


Ignore:
Timestamp:
01/27/2014 02:57:51 AM (11 years ago)
Author:
nacin
Message:

Remove duplicated and superceded balance tags unit tests.

props coffee2code.
fixes #26222.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/balanceTags.php

    r25002 r27040  
    88    function nestable_tags() {
    99        return array(
    10             array( 'blockquote', 'div', 'object', 'q', 'span' )
     10            array( 'blockquote' ), array( 'div' ), array( 'object' ), array( 'q' ), array( 'span' ),
    1111        );
    1212    }
     
    2121    }
    2222
    23     // These are single/self-closing tags that WP has traditionally recognized.
    24     function basic_single_tags() {
    25         return array(
    26             array( 'br' ), array( 'hr' ), array( 'img' ), array( 'input' )
    27         );
    28     }
    29 
    30     /**
    31      * These are single tags WP has traditionally properly handled
    32      * This test can be removed if #1597 is fixed and the next test passes, as
    33      * it supercedes this test.
    34      *
    35      * @dataProvider basic_single_tags
    36      */
    37     function test_selfcloses_unclosed_basic_known_single_tags( $tag ) {
    38         $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) );
    39     }
    40 
    4123    /**
    4224     * If a recognized valid single tag appears unclosed, it should get self-closed
     
    4729    function test_selfcloses_unclosed_known_single_tags( $tag ) {
    4830        $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) );
    49     }
    50 
    51     /**
    52      * These are single tags WP has traditionally properly handled
    53      * This test can be removed if #1597 is fixed and the next test passes, as
    54      * it supercedes this test.
    55      *
    56      * @dataProvider basic_single_tags
    57      */
    58     function test_selfcloses_basic_known_single_tags_having_closing_tag( $tag ) {
    59         $this->assertEquals( "<$tag />", balanceTags( "<$tag></$tag>", true ) );
    6031    }
    6132
     
    12293    }
    12394
    124     function test_balances_nestable_tags() {
    125         $inputs = array(
    126             '<q>Test<q>Test</q>',
    127             '<div><div>Test',
    128             '<div>Test</div></div>',
    129         );
    130         $expected = array(
    131             '<q>Test<q>Test</q></q>',
    132             '<div><div>Test</div></div>',
    133             '<div>Test</div>',
     95    /**
     96     * @dataProvider nestable_tags
     97     */
     98    function test_balances_nestable_tags( $tag ) {
     99        $inputs = array(
     100            "<$tag>Test<$tag>Test</$tag>",
     101            "<$tag><$tag>Test",
     102            "<$tag>Test</$tag></$tag>",
     103        );
     104        $expected = array(
     105            "<$tag>Test<$tag>Test</$tag></$tag>",
     106            "<$tag><$tag>Test</$tag></$tag>",
     107            "<$tag>Test</$tag>",
    134108        );
    135109
     
    157131     */
    158132    function test_allows_immediately_nested_object_tags() {
    159 
    160133        $object = '<object id="obj1"><param name="param1"/><object id="obj2"><param name="param2"/></object></object>';
    161134        $this->assertEquals( $object, balanceTags( $object, true ) );
Note: See TracChangeset for help on using the changeset viewer.