@@ -2055,24 +2055,17 @@ public function test_wp_add_inline_script_after_with_concat() {
20552055
20562056 /**
20572057 * @ticket 14853
2058+ * @ticket 63821
20582059 */
20592060 public function test_wp_add_inline_script_after_and_before_with_concat_and_conditional () {
20602061 global $ wp_scripts ;
20612062
20622063 $ wp_scripts ->do_concat = true ;
20632064 $ wp_scripts ->default_dirs = array ( '/wp-admin/js/ ' , '/wp-includes/js/ ' ); // Default dirs as in wp-includes/script-loader.php.
20642065
2065- $ expected_localized = "<!--[if gte IE 9]> \n" ;
2066- $ expected_localized .= "<script type='text/javascript' id='test-example-js-extra'> \n/* <![CDATA[ */ \nvar testExample = { \"foo \": \"bar \"}; \n/* ]]> */ \n</script> \n" ;
2067- $ expected_localized .= "<![endif]--> \n" ;
2068- $ expected_localized = str_replace ( "' " , '" ' , $ expected_localized );
2069-
2070- $ expected = "<!--[if gte IE 9]> \n" ;
2071- $ expected .= "<script type='text/javascript' id='test-example-js-before'> \n/* <![CDATA[ */ \nconsole.log( \"before \"); \n/* ]]> */ \n</script> \n" ;
2072- $ expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script> \n" ;
2073- $ expected .= "<script type='text/javascript' id='test-example-js-after'> \n/* <![CDATA[ */ \nconsole.log( \"after \"); \n/* ]]> */ \n</script> \n" ;
2074- $ expected .= "<![endif]--> \n" ;
2075- $ expected = str_replace ( "' " , '" ' , $ expected );
2066+ // Conditional scripts should not output.
2067+ $ expected_localized = '' ;
2068+ $ expected = '' ;
20762069
20772070 wp_enqueue_script ( 'test-example ' , 'example.com ' , array (), null );
20782071 wp_localize_script ( 'test-example ' , 'testExample ' , array ( 'foo ' => 'bar ' ) );
@@ -2111,20 +2104,16 @@ public function test_wp_add_inline_script_after_with_concat_and_core_dependency(
21112104
21122105 /**
21132106 * @ticket 36392
2107+ * @ticket 63821
21142108 */
21152109 public function test_wp_add_inline_script_after_with_concat_and_conditional_and_core_dependency () {
2116- global $ wp_scripts, $ wp_version ;
2110+ global $ wp_scripts ;
21172111
21182112 wp_default_scripts ( $ wp_scripts );
21192113
21202114 $ wp_scripts ->base_url = '' ;
21212115 $ wp_scripts ->do_concat = true ;
2122-
2123- $ expected = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate&ver= {$ wp_version }'></script> \n" ;
2124- $ expected .= "<!--[if gte IE 9]> \n" ;
2125- $ expected .= "<script type= \"text/javascript \" src= \"http://example.com \" id= \"test-example-js \"></script> \n" ;
2126- $ expected .= "<script type= \"text/javascript \" id= \"test-example-js-after \"> \n/* <![CDATA[ */ \nconsole.log( \"after \"); \n/* ]]> */ \n</script> \n" ;
2127- $ expected .= "<![endif]--> \n" ;
2116+ $ expected = '' ;
21282117
21292118 wp_enqueue_script ( 'test-example ' , 'http://example.com ' , array ( 'jquery ' ), null );
21302119 wp_add_inline_script ( 'test-example ' , 'console.log("after"); ' );
@@ -2138,19 +2127,17 @@ public function test_wp_add_inline_script_after_with_concat_and_conditional_and_
21382127
21392128 /**
21402129 * @ticket 36392
2130+ * @ticket 63821
21412131 */
21422132 public function test_wp_add_inline_script_before_with_concat_and_core_dependency () {
2143- global $ wp_scripts, $ wp_version ;
2133+ global $ wp_scripts ;
21442134
21452135 wp_default_scripts ( $ wp_scripts );
21462136 wp_default_packages ( $ wp_scripts );
21472137
21482138 $ wp_scripts ->base_url = '' ;
21492139 $ wp_scripts ->do_concat = true ;
2150-
2151- $ expected = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate&ver= {$ wp_version }'></script> \n" ;
2152- $ expected .= "<script type='text/javascript' id='test-example-js-before'> \n/* <![CDATA[ */ \nconsole.log( \"before \"); \n/* ]]> */ \n</script> \n" ;
2153- $ expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script> \n" ;
2140+ $ expected = '' ;
21542141
21552142 wp_enqueue_script ( 'test-example ' , 'http://example.com ' , array ( 'jquery ' ), null );
21562143 wp_add_inline_script ( 'test-example ' , 'console.log("before"); ' , 'before ' );
0 commit comments