Skip to content

Commit c41608f

Browse files
committed
Update emoji tests to account for new JSON encoding
1 parent 154ed40 commit c41608f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/phpunit/tests/formatting/emoji.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public function test_unfiltered_emoji_cdns() {
1919
self::touch( ABSPATH . WPINC . '/js/wp-emoji-loader.js' );
2020
$output = get_echo( '_print_emoji_detection_script' );
2121

22-
$this->assertStringContainsString( wp_json_encode( $this->png_cdn ), $output );
23-
$this->assertStringContainsString( wp_json_encode( $this->svn_cdn ), $output );
22+
$this->assertStringContainsString( wp_json_encode( $this->png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
23+
$this->assertStringContainsString( wp_json_encode( $this->svn_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
2424
}
2525

2626
public function _filtered_emoji_svn_cdn( $cdn = '' ) {
@@ -41,9 +41,9 @@ public function test_filtered_emoji_svn_cdn() {
4141
self::touch( ABSPATH . WPINC . '/js/wp-emoji-loader.js' );
4242
$output = get_echo( '_print_emoji_detection_script' );
4343

44-
$this->assertStringContainsString( wp_json_encode( $this->png_cdn ), $output );
45-
$this->assertStringNotContainsString( wp_json_encode( $this->svn_cdn ), $output );
46-
$this->assertStringContainsString( wp_json_encode( $filtered_svn_cdn ), $output );
44+
$this->assertStringContainsString( wp_json_encode( $this->png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
45+
$this->assertStringNotContainsString( wp_json_encode( $this->svn_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
46+
$this->assertStringContainsString( wp_json_encode( $filtered_svn_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
4747

4848
remove_filter( 'emoji_svg_url', array( $this, '_filtered_emoji_svn_cdn' ) );
4949
}
@@ -66,9 +66,9 @@ public function test_filtered_emoji_png_cdn() {
6666
self::touch( ABSPATH . WPINC . '/js/wp-emoji-loader.js' );
6767
$output = get_echo( '_print_emoji_detection_script' );
6868

69-
$this->assertStringContainsString( wp_json_encode( $filtered_png_cdn ), $output );
70-
$this->assertStringNotContainsString( wp_json_encode( $this->png_cdn ), $output );
71-
$this->assertStringContainsString( wp_json_encode( $this->svn_cdn ), $output );
69+
$this->assertStringContainsString( wp_json_encode( $filtered_png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
70+
$this->assertStringNotContainsString( wp_json_encode( $this->png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
71+
$this->assertStringContainsString( wp_json_encode( $this->svn_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
7272

7373
remove_filter( 'emoji_url', array( $this, '_filtered_emoji_png_cdn' ) );
7474
}

0 commit comments

Comments
 (0)