Ticket #37502: 37502.patch
File 37502.patch, 1.4 KB (added by , 7 years ago) |
---|
-
src/wp-includes/general-template.php
2874 2874 foreach ( array( $wp_scripts, $wp_styles ) as $dependencies ) { 2875 2875 if ( $dependencies instanceof WP_Dependencies && ! empty( $dependencies->queue ) ) { 2876 2876 foreach ( $dependencies->queue as $handle ) { 2877 if ( ! isset( $dependencies->registered[ $handle ] ) ) { 2878 continue; 2879 } 2880 2877 2881 /* @var _WP_Dependency $dependency */ 2878 2882 $dependency = $dependencies->registered[ $handle ]; 2879 2883 $parsed = wp_parse_url( $dependency->src ); -
tests/phpunit/tests/general/resourceHints.php
163 163 $this->assertEquals( $expected, $actual ); 164 164 $this->assertNotContains( $unexpected, $actual ); 165 165 } 166 167 /** 168 * @ticket 37502 169 */ 170 function test_deregistered_scripts_are_ignored() { 171 $expected = "<link rel='dns-prefetch' href='//s.w.org'>\n"; 172 173 wp_enqueue_script( 'test-script', 'http://example.org/script.js' ); 174 wp_deregister_script( 'test-script' ); 175 176 $actual = get_echo( 'wp_resource_hints' ); 177 $this->assertEquals( $expected, $actual ); 178 } 166 179 }