Changeset 60486
- Timestamp:
- 07/18/2025 09:39:21 PM (31 hours ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment.php
r60485 r60486 169 169 170 170 $comment = get_comment( $comment_id ); 171 $this->assertEqualHTML( '<a href="http://example.localhost/something.html" rel="nofollow ugc">click</a>', $comment->comment_content, '<body>', 'Comment: ' . $comment->comment_content ); 171 $this->assertEqualHTML( 172 '<a href="http://example.localhost/something.html" rel="nofollow ugc">click</a>', 173 $comment->comment_content, 174 '<body>', 175 'Comment: ' . $comment->comment_content 176 ); 172 177 } 173 178 -
trunk/tests/phpunit/tests/kses.php
r60446 r60486 18 18 global $allowedposttags; 19 19 20 $this->assert Same( $expected, wp_kses( $content, $allowedposttags ) );20 $this->assertEqualHTML( $expected, wp_kses( $content, $allowedposttags ) ); 21 21 } 22 22 … … 66 66 global $allowedposttags; 67 67 68 $this->assert Same( $expected, wp_kses( $content, $allowedposttags ) );68 $this->assertEqualHTML( $expected, wp_kses( $content, $allowedposttags ) ); 69 69 } 70 70 … … 121 121 */ 122 122 public function test_wp_kses_video( $source, $context, $expected ) { 123 $this->assert Same( $expected, wp_kses( $source, $context ) );123 $this->assertEqualHTML( $expected, wp_kses( $source, $context ) ); 124 124 } 125 125 … … 172 172 global $allowedposttags; 173 173 174 $this->assert Same( $expected, wp_kses( $content, $allowedposttags ) );174 $this->assertEqualHTML( $expected, wp_kses( $content, $allowedposttags ) ); 175 175 } 176 176 … … 233 233 EOF; 234 234 235 $this->assert Same( $expected, wp_kses( $content, $allowedposttags ) );235 $this->assertEqualHTML( $expected, wp_kses( $content, $allowedposttags ) ); 236 236 } 237 237 … … 547 547 $expect_valid_content = '<hyphenated-tag attribute="value">Alot of hyphens.</hyphenated-tag>'; 548 548 549 $this->assert Same( $expect_stripped_content, wp_kses_post( $content ) );550 $this->assert Same( $expect_valid_content, wp_kses( $content, $custom_tags ) );549 $this->assertEqualHTML( $expect_stripped_content, wp_kses_post( $content ) ); 550 $this->assertEqualHTML( $expect_valid_content, wp_kses( $content, $custom_tags ) ); 551 551 } 552 552 … … 614 614 */ 615 615 public function test_wp_kses_normalize_entities( string $input, string $expected ) { 616 $this->assert Same( $expected, wp_kses_normalize_entities( $input ) );616 $this->assertEqualHTML( $expected, wp_kses_normalize_entities( $input ) ); 617 617 } 618 618 … … 626 626 global $allowedposttags; 627 627 628 return $this->assert Same( $expected, wp_kses( $content, $allowedposttags ) );628 return $this->assertEqualHTML( $expected, wp_kses( $content, $allowedposttags ) ); 629 629 } 630 630 … … 663 663 global $allowedposttags; 664 664 665 return $this->assert Same( $expected, wp_kses( $content, $allowedposttags ) );665 return $this->assertEqualHTML( $expected, wp_kses( $content, $allowedposttags ) ); 666 666 } 667 667 … … 918 918 $content = '<p>This is <bdo dir="rtl">a BDO tag</bdo>. Weird, <bdo dir="ltr">right?</bdo></p>'; 919 919 920 $this->assert Same( $content, wp_kses( $content, $allowedposttags ) );920 $this->assertEqualHTML( $content, wp_kses( $content, $allowedposttags ) ); 921 921 } 922 922 … … 929 929 $content = '<ruby>✶<rp>: </rp><rt>Star</rt><rp>, </rp><rt lang="fr">Étoile</rt><rp>.</rp></ruby>'; 930 930 931 $this->assert Same( $content, wp_kses( $content, $allowedposttags ) );931 $this->assertEqualHTML( $content, wp_kses( $content, $allowedposttags ) ); 932 932 } 933 933 … … 940 940 $content = '<ol reversed="reversed"><li>Item 1</li><li>Item 2</li><li>Item 3</li></ol>'; 941 941 942 $this->assert Same( $content, wp_kses( $content, $allowedposttags ) );942 $this->assertEqualHTML( $content, wp_kses( $content, $allowedposttags ) ); 943 943 } 944 944 … … 950 950 $attribute = 'title="foo" class="bar"'; 951 951 952 $this->assert Same( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => array() ), array() ) );952 $this->assertEqualHTML( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => array() ), array() ) ); 953 953 } 954 954 … … 960 960 $attribute = 'title="foo" class="bar"'; 961 961 962 $this->assert Same( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => true ), array() ) );962 $this->assertEqualHTML( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => true ), array() ) ); 963 963 } 964 964 … … 970 970 $attribute = 'title="foo" class="bar"'; 971 971 972 $this->assert Same( "<{$element} title=\"foo\">", wp_kses_attr( $element, $attribute, array( 'foo' => array( 'title' => true ) ), array() ) );972 $this->assertEqualHTML( "<{$element} title=\"foo\">", wp_kses_attr( $element, $attribute, array( 'foo' => array( 'title' => true ) ), array() ) ); 973 973 } 974 974 … … 980 980 $attribute = 'title="foo" class="bar"'; 981 981 982 $this->assert Same( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => false ), array() ) );982 $this->assertEqualHTML( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => false ), array() ) ); 983 983 } 984 984 … … 1424 1424 $expected = '<div data-foo="foo" data-bar="bar" data-two-hyphens="remains">Pens and pencils</div>'; 1425 1425 1426 $this->assert Same( $expected, wp_kses_post( $test ) );1426 $this->assertEqualHTML( $expected, wp_kses_post( $test ) ); 1427 1427 } 1428 1428 … … 1436 1436 $expected = '<div data--leading="remains" data-trailing-="remains" data-middle--double="remains">Pens and pencils</div>'; 1437 1437 1438 $this->assert Same( $expected, wp_kses_post( $test ) );1438 $this->assertEqualHTML( $expected, wp_kses_post( $test ) ); 1439 1439 } 1440 1440 … … 1457 1457 $actual = wp_kses( $content, $allowed_html ); 1458 1458 1459 $this->assert Same( $expected, $actual );1459 $this->assertEqualHTML( $expected, $actual ); 1460 1460 } 1461 1461 … … 1477 1477 $actual = wp_kses( $content, $allowed_html ); 1478 1478 1479 $this->assert Same( $expected, $actual );1479 $this->assertEqualHTML( $expected, $actual ); 1480 1480 } 1481 1481 … … 1762 1762 $html = implode( ' ', $html ); 1763 1763 1764 $this->assert Same( $html, wp_kses_post( $html ) );1764 $this->assertEqualHTML( $html, wp_kses_post( $html ) ); 1765 1765 } 1766 1766 … … 1780 1780 $html = implode( ' ', $test ); 1781 1781 1782 $this->assert Same( $html, wp_kses_post( $html ) );1782 $this->assertEqualHTML( $html, wp_kses_post( $html ) ); 1783 1783 } 1784 1784 … … 1794 1794 */ 1795 1795 public function test_wp_kses_object_tag_allowed( $html, $expected ) { 1796 $this->assert Same( $expected, wp_kses_post( $html ) );1796 $this->assertEqualHTML( $expected, wp_kses_post( $html ) ); 1797 1797 } 1798 1798 … … 1905 1905 public function test_wp_kses_object_data_url_with_port_number_allowed( $html, $expected ) { 1906 1906 add_filter( 'upload_dir', array( $this, 'wp_kses_upload_dir_filter' ), 10, 2 ); 1907 $this->assert Same( $expected, wp_kses_post( $html ) );1907 $this->assertEqualHTML( $expected, wp_kses_post( $html ) ); 1908 1908 } 1909 1909 … … 1971 1971 remove_filter( 'wp_kses_allowed_html', array( $this, 'filter_wp_kses_object_added_in_html_filter' ) ); 1972 1972 1973 $this->assert Same( $html, $filtered_html );1973 $this->assertEqualHTML( $html, $filtered_html ); 1974 1974 } 1975 1975 … … 2002 2002 */ 2003 2003 public function test_wp_kses_preserves_html_comments( $html_comment, $expected_output ) { 2004 $this->assert Same(2004 $this->assertEqualHTML( 2005 2005 $expected_output, 2006 2006 wp_kses( $html_comment, array() ), 2007 '<body>', 2007 2008 'Failed to properly preserve HTML comment.' 2008 2009 ); … … 2034 2035 */ 2035 2036 public function test_wp_kses_allowed_values_list( $content, $expected, $allowed_html ) { 2036 $this->assert Same( $expected, wp_kses( $content, $allowed_html ) );2037 $this->assertEqualHTML( $expected, wp_kses( $content, $allowed_html ) ); 2037 2038 } 2038 2039 … … 2092 2093 */ 2093 2094 public function test_wp_kses_required_attribute( $content, $expected, $allowed_html ) { 2094 $this->assert Same( $expected, wp_kses( $content, $allowed_html ) );2095 $this->assertEqualHTML( $expected, wp_kses( $content, $allowed_html ) ); 2095 2096 } 2096 2097 … … 2313 2314 $allowed = wp_kses_allowed_html( $context ); 2314 2315 $this->assertTrue( isset( $allowed['a']['target'] ), "Target attribute not allowed in {$context}" ); 2315 $this->assertEqual s( $expected, wp_kses( $input, $context ) );2316 $this->assertEqualHTML( $expected, wp_kses( $input, $context ) ); 2316 2317 } 2317 2318
Note: See TracChangeset
for help on using the changeset viewer.