File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
tests/phpunit/tests/dependencies Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -4075,4 +4075,22 @@ public function test_source_url_with_concat() {
40754075
40764076 $ this ->assertEqualHTML ( $ expected , $ print_scripts );
40774077 }
4078+
4079+ /**
4080+ * Ensure that `::print_translations()` does not include the sourceURL comment when `$display` is false.
4081+ *
4082+ * @ticket 63887
4083+ * @covers ::print_translations
4084+ */
4085+ public function test_print_translations_no_display_no_sourceurl () {
4086+ global $ wp_scripts ;
4087+ $ this ->add_html5_script_theme_support ();
4088+
4089+ wp_register_script ( 'wp-i18n ' , '/wp-includes/js/dist/wp-i18n.js ' , array (), null );
4090+ wp_enqueue_script ( 'test-example ' , '/wp-includes/js/script.js ' , array (), null );
4091+ wp_set_script_translations ( 'test-example ' , 'default ' , DIR_TESTDATA . '/languages ' );
4092+
4093+ $ translations_script_data = $ wp_scripts ->print_translations ( 'test-example ' , false );
4094+ $ this ->assertStringNotContainsStringIgnoringCase ( 'sourceURL= ' , $ translations_script_data );
4095+ }
40784096}
You can’t perform that action at this time.
0 commit comments