66 */
77class Tests_Formatting_Emoji extends WP_UnitTestCase {
88
9- private $ png_cdn = 'https://s.w.org/images/core/emoji/17.0.2/72x72/ ' ;
10- private $ svg_cdn = 'https://s.w.org/images/core/emoji/17.0.2/svg/ ' ;
9+ private static $ png_cdn = 'https://s.w.org/images/core/emoji/17.0.2/72x72/ ' ;
10+ private static $ svg_cdn = 'https://s.w.org/images/core/emoji/17.0.2/svg/ ' ;
1111
1212 /**
1313 * Tests that the emoji detection script is hooked onto the front end footer
@@ -192,9 +192,9 @@ public function test_script_tag_printing() {
192192 array ( 'baseUrl ' , 'ext ' , 'svgUrl ' , 'svgExt ' , 'source ' ),
193193 array_keys ( $ settings )
194194 );
195- $ this ->assertSame ( $ this -> png_cdn , $ settings ['baseUrl ' ] );
195+ $ this ->assertSame ( self :: $ png_cdn , $ settings ['baseUrl ' ] );
196196 $ this ->assertSame ( '.png ' , $ settings ['ext ' ] );
197- $ this ->assertSame ( $ this -> svg_cdn , $ settings ['svgUrl ' ] );
197+ $ this ->assertSame ( self :: $ svg_cdn , $ settings ['svgUrl ' ] );
198198 $ this ->assertSame ( '.svg ' , $ settings ['svgExt ' ] );
199199 $ this ->assertIsArray ( $ settings ['source ' ] );
200200 $ this ->assertArrayHasKey ( 'wpemoji ' , $ settings ['source ' ] );
@@ -216,8 +216,8 @@ public function test_unfiltered_emoji_cdns() {
216216 self ::touch ( ABSPATH . WPINC . '/js/wp-emoji-loader.js ' );
217217 $ output = get_echo ( '_print_emoji_detection_script ' );
218218
219- $ this ->assertStringContainsString ( wp_json_encode ( $ this -> png_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
220- $ this ->assertStringContainsString ( wp_json_encode ( $ this -> svg_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
219+ $ this ->assertStringContainsString ( wp_json_encode ( self :: $ png_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
220+ $ this ->assertStringContainsString ( wp_json_encode ( self :: $ svg_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
221221 }
222222
223223 public function _filtered_emoji_svg_cdn ( $ cdn = '' ) {
@@ -238,8 +238,8 @@ public function test_filtered_emoji_svn_cdn() {
238238 self ::touch ( ABSPATH . WPINC . '/js/wp-emoji-loader.js ' );
239239 $ output = get_echo ( '_print_emoji_detection_script ' );
240240
241- $ this ->assertStringContainsString ( wp_json_encode ( $ this -> png_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
242- $ this ->assertStringNotContainsString ( wp_json_encode ( $ this -> svg_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
241+ $ this ->assertStringContainsString ( wp_json_encode ( self :: $ png_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
242+ $ this ->assertStringNotContainsString ( wp_json_encode ( self :: $ svg_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
243243 $ this ->assertStringContainsString ( wp_json_encode ( $ filtered_svn_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
244244
245245 remove_filter ( 'emoji_svg_url ' , array ( $ this , '_filtered_emoji_svg_cdn ' ) );
@@ -264,8 +264,8 @@ public function test_filtered_emoji_png_cdn() {
264264 $ output = get_echo ( '_print_emoji_detection_script ' );
265265
266266 $ this ->assertStringContainsString ( wp_json_encode ( $ filtered_png_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
267- $ this ->assertStringNotContainsString ( wp_json_encode ( $ this -> png_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
268- $ this ->assertStringContainsString ( wp_json_encode ( $ this -> svg_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
267+ $ this ->assertStringNotContainsString ( wp_json_encode ( self :: $ png_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
268+ $ this ->assertStringContainsString ( wp_json_encode ( self :: $ svg_cdn , JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $ output );
269269
270270 remove_filter ( 'emoji_url ' , array ( $ this , '_filtered_emoji_png_cdn ' ) );
271271 }
@@ -295,7 +295,7 @@ public function test_wp_emoji_list_returns_data() {
295295 $ this ->assertNotSame ( $ default , $ partials );
296296 }
297297
298- public function data_wp_encode_emoji () {
298+ public static function data_wp_encode_emoji () {
299299 return array (
300300 array (
301301 // Not emoji.
@@ -335,7 +335,7 @@ public function test_wp_encode_emoji( $emoji, $expected ) {
335335 $ this ->assertSame ( $ expected , wp_encode_emoji ( $ emoji ) );
336336 }
337337
338- public function data_wp_staticize_emoji () {
338+ public static function data_wp_staticize_emoji () {
339339 $ data = array (
340340 array (
341341 // Not emoji.
@@ -345,22 +345,22 @@ public function data_wp_staticize_emoji() {
345345 array (
346346 // Simple emoji.
347347 '🙂 ' ,
348- '<img src=" ' . $ this -> png_cdn . '1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ' ,
348+ '<img src=" ' . self :: $ png_cdn . '1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ' ,
349349 ),
350350 array (
351351 // Skin tone, gender, ZWJ, emoji selector.
352352 '👮🏼♀️ ' ,
353- '<img src=" ' . $ this -> png_cdn . '1f46e-1f3fc-200d-2640-fe0f.png" alt="👮🏼♀️" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ' ,
353+ '<img src=" ' . self :: $ png_cdn . '1f46e-1f3fc-200d-2640-fe0f.png" alt="👮🏼♀️" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ' ,
354354 ),
355355 array (
356356 // Unicode 10.
357357 '🧚 ' ,
358- '<img src=" ' . $ this -> png_cdn . '1f9da.png" alt="🧚" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ' ,
358+ '<img src=" ' . self :: $ png_cdn . '1f9da.png" alt="🧚" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ' ,
359359 ),
360360 array (
361361 // Hairy creature (Unicode 17).
362362 ' ' ,
363- '<img src=" ' . $ this -> png_cdn . '1fac8.png" alt="" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ' ,
363+ '<img src=" ' . self :: $ png_cdn . '1fac8.png" alt="" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ' ,
364364 ),
365365 );
366366
0 commit comments