Changeset 27040 for trunk/tests/phpunit/tests/formatting/balanceTags.php
- Timestamp:
- 01/27/2014 02:57:51 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/balanceTags.php
r25002 r27040 8 8 function nestable_tags() { 9 9 return array( 10 array( 'blockquote' , 'div', 'object', 'q', 'span' )10 array( 'blockquote' ), array( 'div' ), array( 'object' ), array( 'q' ), array( 'span' ), 11 11 ); 12 12 } … … 21 21 } 22 22 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 handled32 * This test can be removed if #1597 is fixed and the next test passes, as33 * it supercedes this test.34 *35 * @dataProvider basic_single_tags36 */37 function test_selfcloses_unclosed_basic_known_single_tags( $tag ) {38 $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) );39 }40 41 23 /** 42 24 * If a recognized valid single tag appears unclosed, it should get self-closed … … 47 29 function test_selfcloses_unclosed_known_single_tags( $tag ) { 48 30 $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) ); 49 }50 51 /**52 * These are single tags WP has traditionally properly handled53 * This test can be removed if #1597 is fixed and the next test passes, as54 * it supercedes this test.55 *56 * @dataProvider basic_single_tags57 */58 function test_selfcloses_basic_known_single_tags_having_closing_tag( $tag ) {59 $this->assertEquals( "<$tag />", balanceTags( "<$tag></$tag>", true ) );60 31 } 61 32 … … 122 93 } 123 94 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>", 134 108 ); 135 109 … … 157 131 */ 158 132 function test_allows_immediately_nested_object_tags() { 159 160 133 $object = '<object id="obj1"><param name="param1"/><object id="obj2"><param name="param2"/></object></object>'; 161 134 $this->assertEquals( $object, balanceTags( $object, true ) );
Note: See TracChangeset
for help on using the changeset viewer.