Skip to content

Commit f59a3c0

Browse files
committed
HTML API: Use assertEqualHTML() in wp_rel_nofollow() tests.
1 parent 8900f0a commit f59a3c0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/phpunit/tests/formatting/wpRelNofollow.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ class Tests_Formatting_wpRelNofollow extends WP_UnitTestCase {
1212
*/
1313
public function test_add_no_follow() {
1414
$content = '<p>This is some cool <a href="/">Code</a></p>';
15-
$expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow\">Code</a></p>';
16-
$this->assertSame( $expected, wp_rel_nofollow( $content ) );
15+
$expected = '<p>This is some cool <a href="/" rel="nofollow">Code</a></p>';
16+
$this->assertEqualHTML( $expected, stripslashes( wp_rel_nofollow( $content ) ) );
1717
}
1818

1919
/**
2020
* @ticket 9959
2121
*/
2222
public function test_convert_no_follow() {
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\">Code</a></p>';
25-
$this->assertSame( $expected, wp_rel_nofollow( $content ) );
24+
$expected = '<p>This is some cool <a href="/" rel="weird nofollow">Code</a></p>';
25+
$this->assertEqualHTML( $expected, stripslashes( wp_rel_nofollow( $content ) ) );
2626
}
2727

2828
/**
2929
* @ticket 11360
3030
* @dataProvider data_wp_rel_nofollow
3131
*/
3232
public function test_wp_rel_nofollow( $input, $output, $expect_deprecation = false ) {
33-
$this->assertSame( wp_slash( $output ), wp_rel_nofollow( $input ) );
33+
$this->assertEqualHTML( $output, stripslashes( wp_rel_nofollow( $input ) ) );
3434
}
3535

3636
public function data_wp_rel_nofollow() {
@@ -80,7 +80,7 @@ public function data_wp_rel_nofollow() {
8080

8181
public function test_append_no_follow_with_valueless_attribute() {
8282
$content = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>';
83-
$expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow\">Code</a></p>';
84-
$this->assertSame( $expected, wp_rel_nofollow( $content ) );
83+
$expected = '<p>This is some cool <a href="demo.com" download rel="hola nofollow">Code</a></p>';
84+
$this->assertEqualHTML( $expected, stripslashes( wp_rel_nofollow( $content ) ) );
8585
}
8686
}

0 commit comments

Comments
 (0)