From d867180a4bf0d81ab6793a6da8c7ea59a6190546 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Sat, 12 Jul 2025 13:12:04 -0500 Subject: [PATCH] HTML API: Use `assertEqualHTML()` in `wp_rel_nofollow()` tests. --- tests/phpunit/tests/formatting/wpRelNofollow.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/tests/formatting/wpRelNofollow.php b/tests/phpunit/tests/formatting/wpRelNofollow.php index 41cf835313444..83a9c00c23e95 100644 --- a/tests/phpunit/tests/formatting/wpRelNofollow.php +++ b/tests/phpunit/tests/formatting/wpRelNofollow.php @@ -12,8 +12,8 @@ class Tests_Formatting_wpRelNofollow extends WP_UnitTestCase { */ public function test_add_no_follow() { $content = '

This is some cool Code

'; - $expected = '

This is some cool Code

'; - $this->assertSame( $expected, wp_rel_nofollow( $content ) ); + $expected = '

This is some cool Code

'; + $this->assertEqualHTML( $expected, stripslashes( wp_rel_nofollow( $content ) ) ); } /** @@ -21,8 +21,8 @@ public function test_add_no_follow() { */ public function test_convert_no_follow() { $content = '

This is some cool Code

'; - $expected = '

This is some cool Code

'; - $this->assertSame( $expected, wp_rel_nofollow( $content ) ); + $expected = '

This is some cool Code

'; + $this->assertEqualHTML( $expected, stripslashes( wp_rel_nofollow( $content ) ) ); } /** @@ -30,7 +30,7 @@ public function test_convert_no_follow() { * @dataProvider data_wp_rel_nofollow */ public function test_wp_rel_nofollow( $input, $output, $expect_deprecation = false ) { - $this->assertSame( wp_slash( $output ), wp_rel_nofollow( $input ) ); + $this->assertEqualHTML( $output, stripslashes( wp_rel_nofollow( $input ) ) ); } public function data_wp_rel_nofollow() { @@ -80,7 +80,7 @@ public function data_wp_rel_nofollow() { public function test_append_no_follow_with_valueless_attribute() { $content = '

This is some cool Code

'; - $expected = '

This is some cool Code

'; - $this->assertSame( $expected, wp_rel_nofollow( $content ) ); + $expected = '

This is some cool Code

'; + $this->assertEqualHTML( $expected, stripslashes( wp_rel_nofollow( $content ) ) ); } }