Changeset 38473
- Timestamp:
- 08/31/2016 05:25:03 PM (8 years ago)
- Location:
- branches/4.6
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6
- Property svn:mergeinfo changed
/trunk merged: 38443,38447
- Property svn:mergeinfo changed
-
branches/4.6/src/wp-includes/general-template.php
r38256 r38473 2854 2854 2855 2855 foreach ( $urls as $url ) { 2856 printf( "<link rel='%s' href='%s' >\n", $relation_type, $url );2856 printf( "<link rel='%s' href='%s' />\n", $relation_type, $url ); 2857 2857 } 2858 2858 } -
branches/4.6/tests/phpunit/tests/general/resourceHints.php
r38256 r38473 32 32 33 33 function test_should_have_defaults_on_frontend() { 34 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n";34 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n"; 35 35 36 36 $this->expectOutputString( $expected ); … … 40 40 41 41 function test_dns_prefetching() { 42 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n" .43 "<link rel='dns-prefetch' href='//wordpress.org' >\n" .44 "<link rel='dns-prefetch' href='//google.com' >\n" .45 "<link rel='dns-prefetch' href='//make.wordpress.org' >\n";42 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" . 43 "<link rel='dns-prefetch' href='//wordpress.org' />\n" . 44 "<link rel='dns-prefetch' href='//google.com' />\n" . 45 "<link rel='dns-prefetch' href='//make.wordpress.org' />\n"; 46 46 47 47 add_filter( 'wp_resource_hints', array( $this, '_add_dns_prefetch_domains' ), 10, 2 ); … … 71 71 */ 72 72 function test_preconnect() { 73 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n" .74 "<link rel='preconnect' href='//wordpress.org' >\n" .75 "<link rel='preconnect' href='https://make.wordpress.org' >\n" .76 "<link rel='preconnect' href='http://google.com' >\n" .77 "<link rel='preconnect' href='http://w.org' >\n";73 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" . 74 "<link rel='preconnect' href='//wordpress.org' />\n" . 75 "<link rel='preconnect' href='https://make.wordpress.org' />\n" . 76 "<link rel='preconnect' href='http://google.com' />\n" . 77 "<link rel='preconnect' href='http://w.org' />\n"; 78 78 79 79 add_filter( 'wp_resource_hints', array( $this, '_add_preconnect_domains' ), 10, 2 ); … … 99 99 100 100 function test_prerender() { 101 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n" .102 "<link rel='prerender' href='https://make.wordpress.org/great-again' >\n" .103 "<link rel='prerender' href='http://jobs.wordpress.net' >\n" .104 "<link rel='prerender' href='//core.trac.wordpress.org' >\n";101 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" . 102 "<link rel='prerender' href='https://make.wordpress.org/great-again' />\n" . 103 "<link rel='prerender' href='http://jobs.wordpress.net' />\n" . 104 "<link rel='prerender' href='//core.trac.wordpress.org' />\n"; 105 105 106 106 add_filter( 'wp_resource_hints', array( $this, '_add_prerender_urls' ), 10, 2 ); … … 125 125 126 126 function test_parse_url_dns_prefetch() { 127 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n" .128 "<link rel='dns-prefetch' href='//make.wordpress.org' >\n";127 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" . 128 "<link rel='dns-prefetch' href='//make.wordpress.org' />\n"; 129 129 130 130 add_filter( 'wp_resource_hints', array( $this, '_add_dns_prefetch_long_urls' ), 10, 2 ); … … 146 146 147 147 function test_dns_prefetch_styles() { 148 $expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' >\n" .149 "<link rel='dns-prefetch' href='//s.w.org' >\n";148 $expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' />\n" . 149 "<link rel='dns-prefetch' href='//s.w.org' />\n"; 150 150 151 151 $args = array( … … 165 165 166 166 function test_dns_prefetch_scripts() { 167 $expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' >\n" .168 "<link rel='dns-prefetch' href='//s.w.org' >\n";167 $expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' />\n" . 168 "<link rel='dns-prefetch' href='//s.w.org' />\n"; 169 169 170 170 $args = array( … … 183 183 184 184 function test_dns_prefetch_scripts_does_not_included_registered_only() { 185 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n";186 $unexpected = "<link rel='dns-prefetch' href='//wordpress.org' >\n";185 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n"; 186 $unexpected = "<link rel='dns-prefetch' href='//wordpress.org' />\n"; 187 187 188 188 wp_register_script( 'jquery-elsewhere', 'https://wordpress.org/wp-includes/js/jquery/jquery.js' ); … … 200 200 */ 201 201 function test_deregistered_scripts_are_ignored() { 202 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n";202 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n"; 203 203 204 204 wp_enqueue_script( 'test-script', 'http://example.org/script.js' ); … … 213 213 */ 214 214 function test_malformed_urls() { 215 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n";215 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n"; 216 216 217 217 // Errant colon.
Note: See TracChangeset
for help on using the changeset viewer.