diff --git a/tests/phpunit/tests/formatting/balanceTags.php b/tests/phpunit/tests/formatting/balanceTags.php index de61b0bb6e..4b72b04993 100644 --- a/tests/phpunit/tests/formatting/balanceTags.php +++ b/tests/phpunit/tests/formatting/balanceTags.php @@ -7,7 +7,7 @@ class Tests_Formatting_BalanceTags extends WP_UnitTestCase { function nestable_tags() { return array( - array( 'blockquote', 'div', 'object', 'q', 'span' ) + array( 'blockquote' ), array( 'div' ), array( 'object' ), array( 'q' ), array( 'span' ), ); } @@ -20,24 +20,6 @@ class Tests_Formatting_BalanceTags extends WP_UnitTestCase { ); } - // These are single/self-closing tags that WP has traditionally recognized. - function basic_single_tags() { - return array( - array( 'br' ), array( 'hr' ), array( 'img' ), array( 'input' ) - ); - } - - /** - * These are single tags WP has traditionally properly handled - * This test can be removed if #1597 is fixed and the next test passes, as - * it supercedes this test. - * - * @dataProvider basic_single_tags - */ - function test_selfcloses_unclosed_basic_known_single_tags( $tag ) { - $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) ); - } - /** * If a recognized valid single tag appears unclosed, it should get self-closed * @@ -48,17 +30,6 @@ class Tests_Formatting_BalanceTags extends WP_UnitTestCase { $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) ); } - /** - * These are single tags WP has traditionally properly handled - * This test can be removed if #1597 is fixed and the next test passes, as - * it supercedes this test. - * - * @dataProvider basic_single_tags - */ - function test_selfcloses_basic_known_single_tags_having_closing_tag( $tag ) { - $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) ); - } - /** * If a recognized valid single tag is given a closing tag, the closing tag * should get removed and tag should be self-closed. @@ -121,16 +92,19 @@ class Tests_Formatting_BalanceTags extends WP_UnitTestCase { } } - function test_balances_nestable_tags() { + /** + * @dataProvider nestable_tags + */ + function test_balances_nestable_tags( $tag ) { $inputs = array( - 'TestTest', - '
Test', - '
Test
', + "<$tag>Test<$tag>Test", + "<$tag><$tag>Test", + "<$tag>Test", ); $expected = array( - 'TestTest', - '
Test
', - '
Test
', + "<$tag>Test<$tag>Test", + "<$tag><$tag>Test", + "<$tag>Test", ); foreach ( $inputs as $key => $input ) { @@ -156,7 +130,6 @@ class Tests_Formatting_BalanceTags extends WP_UnitTestCase { * @ticket 20401 */ function test_allows_immediately_nested_object_tags() { - $object = ''; $this->assertEquals( $object, balanceTags( $object, true ) ); }