Changeset 50072 for trunk/tests/phpunit/tests/https-detection.php
- Timestamp:
- 01/29/2021 07:09:49 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/https-detection.php
r49904 r50072 142 142 * @ticket 47577 143 143 */ 144 public function test_wp_is_ owned_html_output_via_rsd_link() {144 public function test_wp_is_local_html_output_via_rsd_link() { 145 145 // HTML includes RSD link. 146 146 $head_tag = get_echo( 'rsd_link' ); 147 147 $html = $this->get_sample_html_string( $head_tag ); 148 $this->assertTrue( wp_is_ owned_html_output( $html ) );148 $this->assertTrue( wp_is_local_html_output( $html ) ); 149 149 150 150 // HTML includes modified RSD link but same URL. 151 151 $head_tag = str_replace( ' />', '>', get_echo( 'rsd_link' ) ); 152 152 $html = $this->get_sample_html_string( $head_tag ); 153 $this->assertTrue( wp_is_ owned_html_output( $html ) );153 $this->assertTrue( wp_is_local_html_output( $html ) ); 154 154 155 155 // HTML does not include RSD link. 156 156 $html = $this->get_sample_html_string(); 157 $this->assertFalse( wp_is_ owned_html_output( $html ) );158 } 159 160 /** 161 * @ticket 47577 162 */ 163 public function test_wp_is_ owned_html_output_via_wlwmanifest_link() {157 $this->assertFalse( wp_is_local_html_output( $html ) ); 158 } 159 160 /** 161 * @ticket 47577 162 */ 163 public function test_wp_is_local_html_output_via_wlwmanifest_link() { 164 164 remove_action( 'wp_head', 'rsd_link' ); 165 165 … … 167 167 $head_tag = get_echo( 'wlwmanifest_link' ); 168 168 $html = $this->get_sample_html_string( $head_tag ); 169 $this->assertTrue( wp_is_ owned_html_output( $html ) );169 $this->assertTrue( wp_is_local_html_output( $html ) ); 170 170 171 171 // HTML includes modified WLW manifest link but same URL. 172 172 $head_tag = str_replace( ' />', '>', get_echo( 'wlwmanifest_link' ) ); 173 173 $html = $this->get_sample_html_string( $head_tag ); 174 $this->assertTrue( wp_is_ owned_html_output( $html ) );174 $this->assertTrue( wp_is_local_html_output( $html ) ); 175 175 176 176 // HTML includes WLW manifest link with alternative URL scheme. … … 178 178 $head_tag = false !== strpos( $head_tag, 'https://' ) ? str_replace( 'https://', 'http://', $head_tag ) : str_replace( 'http://', 'https://', $head_tag ); 179 179 $html = $this->get_sample_html_string( $head_tag ); 180 $this->assertTrue( wp_is_ owned_html_output( $html ) );180 $this->assertTrue( wp_is_local_html_output( $html ) ); 181 181 182 182 // HTML does not include WLW manifest link. 183 183 $html = $this->get_sample_html_string(); 184 $this->assertFalse( wp_is_ owned_html_output( $html ) );185 } 186 187 /** 188 * @ticket 47577 189 */ 190 public function test_wp_is_ owned_html_output_via_rest_link() {184 $this->assertFalse( wp_is_local_html_output( $html ) ); 185 } 186 187 /** 188 * @ticket 47577 189 */ 190 public function test_wp_is_local_html_output_via_rest_link() { 191 191 remove_action( 'wp_head', 'rsd_link' ); 192 192 remove_action( 'wp_head', 'wlwmanifest_link' ); … … 195 195 $head_tag = get_echo( 'rest_output_link_wp_head' ); 196 196 $html = $this->get_sample_html_string( $head_tag ); 197 $this->assertTrue( wp_is_ owned_html_output( $html ) );197 $this->assertTrue( wp_is_local_html_output( $html ) ); 198 198 199 199 // HTML includes modified REST API link but same URL. 200 200 $head_tag = str_replace( ' />', '>', get_echo( 'rest_output_link_wp_head' ) ); 201 201 $html = $this->get_sample_html_string( $head_tag ); 202 $this->assertTrue( wp_is_ owned_html_output( $html ) );202 $this->assertTrue( wp_is_local_html_output( $html ) ); 203 203 204 204 // HTML includes REST API link with alternative URL scheme. … … 206 206 $head_tag = false !== strpos( $head_tag, 'https://' ) ? str_replace( 'https://', 'http://', $head_tag ) : str_replace( 'http://', 'https://', $head_tag ); 207 207 $html = $this->get_sample_html_string( $head_tag ); 208 $this->assertTrue( wp_is_ owned_html_output( $html ) );208 $this->assertTrue( wp_is_local_html_output( $html ) ); 209 209 210 210 // HTML does not include REST API link. 211 211 $html = $this->get_sample_html_string(); 212 $this->assertFalse( wp_is_ owned_html_output( $html ) );213 } 214 215 /** 216 * @ticket 47577 217 */ 218 public function test_wp_is_ owned_html_output_cannot_determine() {212 $this->assertFalse( wp_is_local_html_output( $html ) ); 213 } 214 215 /** 216 * @ticket 47577 217 */ 218 public function test_wp_is_local_html_output_cannot_determine() { 219 219 remove_action( 'wp_head', 'rsd_link' ); 220 220 remove_action( 'wp_head', 'wlwmanifest_link' ); … … 223 223 // The HTML here doesn't matter because all hooks are removed. 224 224 $html = $this->get_sample_html_string(); 225 $this->assertNull( wp_is_ owned_html_output( $html ) );225 $this->assertNull( wp_is_local_html_output( $html ) ); 226 226 } 227 227
Note: See TracChangeset
for help on using the changeset viewer.