@@ -12,25 +12,25 @@ class Tests_Formatting_wpRelUgc extends WP_UnitTestCase {
1212 */
1313 public function test_add_ugc () {
1414 $ content = '<p>This is some cool <a href="/">Code</a></p> ' ;
15- $ expected = '<p>This is some cool <a href=\"/\ " rel=\ "nofollow ugc\ ">Code</a></p> ' ;
16- $ this ->assertSame ( $ expected , wp_rel_ugc ( $ content ) );
15+ $ expected = '<p>This is some cool <a href="/ " rel="nofollow ugc">Code</a></p> ' ;
16+ $ this ->assertEqualHTML ( $ expected , stripslashes ( wp_rel_ugc ( $ content ) ) );
1717 }
1818
1919 /**
2020 * @ticket 48022
2121 */
2222 public function test_convert_ugc () {
2323 $ content = '<p>This is some cool <a href="/" rel="weird">Code</a></p> ' ;
24- $ expected = '<p>This is some cool <a href=\"/\ " rel=\ "weird nofollow ugc\ ">Code</a></p> ' ;
25- $ this ->assertSame ( $ expected , wp_rel_ugc ( $ content ) );
24+ $ expected = '<p>This is some cool <a href="/ " rel="weird nofollow ugc">Code</a></p> ' ;
25+ $ this ->assertEqualHTML ( $ expected , stripslashes ( wp_rel_ugc ( $ content ) ) );
2626 }
2727
2828 /**
2929 * @ticket 48022
3030 * @dataProvider data_wp_rel_ugc
3131 */
3232 public function test_wp_rel_ugc ( $ input , $ output , $ expect_deprecation = false ) {
33- $ this ->assertSame ( wp_slash ( $ output ), wp_rel_ugc ( $ input ) );
33+ $ this ->assertEqualHTML ( $ output , stripslashes ( wp_rel_ugc ( $ input ) ) );
3434 }
3535
3636 public function data_wp_rel_ugc () {
@@ -81,7 +81,7 @@ public function data_wp_rel_ugc() {
8181 public function test_append_ugc_with_valueless_attribute () {
8282
8383 $ content = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p> ' ;
84- $ expected = '<p>This is some cool <a href=\ "demo.com\ " download rel=\ "hola nofollow ugc\ ">Code</a></p> ' ;
85- $ this ->assertSame ( $ expected , wp_rel_ugc ( $ content ) );
84+ $ expected = '<p>This is some cool <a href="demo.com" download rel="hola nofollow ugc">Code</a></p> ' ;
85+ $ this ->assertEqualHTML ( $ expected , stripslashes ( wp_rel_ugc ( $ content ) ) );
8686 }
8787}
0 commit comments