File tree Expand file tree Collapse file tree
tests/phpunit/tests/dependencies Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2231,10 +2231,9 @@ function _print_scripts() {
22312231
22322232 if ( $ concat ) {
22332233 if ( ! empty ( $ wp_scripts ->print_code ) ) {
2234- echo "\n<script> \n" ;
2235- echo $ wp_scripts ->print_code ;
2236- echo sprintf ( "\n//# sourceURL=%s \n" , rawurlencode ( 'js-inline-concat- ' . $ concat ) );
2237- echo "</script> \n" ;
2234+ $ inline_code = $ wp_scripts ->print_code
2235+ . sprintf ( "\n//# sourceURL=%s " , rawurlencode ( 'js-inline-concat- ' . $ concat ) );
2236+ wp_print_inline_script_tag ( $ inline_code );
22382237 }
22392238
22402239 $ concat = str_split ( $ concat , 128 );
@@ -2245,7 +2244,7 @@ function _print_scripts() {
22452244 }
22462245
22472246 $ src = $ wp_scripts ->base_url . "/wp-admin/load-scripts.php?c= {$ zip }" . $ concatenated . '&ver= ' . $ wp_scripts ->default_version ;
2248- echo " <script src=' " . esc_attr ( $ src ) . " '></script> \n" ;
2247+ wp_print_script_tag ( array ( ' src ' => $ src ) ) ;
22492248 }
22502249
22512250 if ( ! empty ( $ wp_scripts ->print_html ) ) {
Original file line number Diff line number Diff line change @@ -2058,9 +2058,9 @@ public function test_script_concatenation() {
20582058 wp_print_scripts ();
20592059 $ print_scripts = get_echo ( '_print_scripts ' );
20602060
2061- $ expected = "<script src=' /wp-admin/load-scripts.php?c=0& ;load%5Bchunk_0%5D=one,two,three& ;ver= {$ wp_version }' ></script> \n" ;
2061+ $ expected = "<script src= \" /wp-admin/load-scripts.php?c=0& ;load%5Bchunk_0%5D=one,two,three& ;ver= {$ wp_version }\" ></script> \n" ;
20622062
2063- $ this ->assertSame ( $ expected , $ print_scripts );
2063+ $ this ->assertEqualHTML ( $ expected , $ print_scripts );
20642064 }
20652065
20662066 /**
@@ -4093,12 +4093,11 @@ public function test_source_url_with_concat() {
40934093 $ print_scripts = get_echo ( '_print_scripts ' );
40944094
40954095 $ expected = <<<HTML
4096-
40974096<script>
40984097var one = {"key":"val"};var two = {"key":"val"};
40994098//# sourceURL=js-inline-concat-one%2Ctwo
41004099</script>
4101- <script src="/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=one,two&ver= {$ wp_version }"></script>
4100+ <script src="/wp-admin/load-scripts.php?c=0& load%5Bchunk_0%5D=one,two& ver= {$ wp_version }"></script>
41024101
41034102HTML ;
41044103
You can’t perform that action at this time.
0 commit comments