@@ -12,25 +12,25 @@ class Tests_Formatting_wpRelNofollow extends WP_UnitTestCase {
12
12
*/
13
13
public function test_add_no_follow () {
14
14
$ 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 ) ) );
17
17
}
18
18
19
19
/**
20
20
* @ticket 9959
21
21
*/
22
22
public function test_convert_no_follow () {
23
23
$ 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 ) ) );
26
26
}
27
27
28
28
/**
29
29
* @ticket 11360
30
30
* @dataProvider data_wp_rel_nofollow
31
31
*/
32
32
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 ) ) );
34
34
}
35
35
36
36
public function data_wp_rel_nofollow () {
@@ -80,7 +80,7 @@ public function data_wp_rel_nofollow() {
80
80
81
81
public function test_append_no_follow_with_valueless_attribute () {
82
82
$ 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 ) ) );
85
85
}
86
86
}
0 commit comments