Changeset 36721 for trunk/tests/phpunit/tests/post/attachments.php
- Timestamp:
- 02/26/2016 02:08:47 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/attachments.php
r36711 r36721 297 297 $attachment_id = $this->_make_attachment( $upload ); 298 298 299 // Save server data for cleanup.300 $is_ssl = is_ssl();301 299 $_SERVER['HTTPS'] = 'off'; 302 300 303 301 $url = wp_get_attachment_url( $attachment_id ); 304 305 // Cleanup.306 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off';307 302 308 303 $this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) ); … … 327 322 $attachment_id = $this->_make_attachment( $upload ); 328 323 329 // Save server data for cleanup.330 $is_ssl = is_ssl();331 324 $_SERVER['HTTPS'] = 'off'; 332 325 333 326 $url = wp_get_attachment_url( $attachment_id ); 334 335 // Cleanup.336 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off';337 327 338 328 $this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) ); … … 357 347 $attachment_id = $this->_make_attachment( $upload ); 358 348 359 // Save server data for cleanup360 $is_ssl = is_ssl();361 $http_host = $_SERVER['HTTP_HOST'];362 363 349 $_SERVER['HTTPS'] = 'on'; 364 350 … … 370 356 $url = wp_get_attachment_url( $attachment_id ); 371 357 372 // Cleanup.373 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off';374 $_SERVER['HTTP_HOST'] = $http_host;375 376 358 $this->assertSame( 'https', parse_url( $url, PHP_URL_SCHEME ) ); 377 359 } … … 393 375 $attachment_id = $this->_make_attachment( $upload ); 394 376 395 // Save server data for cleanup.396 $is_ssl = is_ssl();397 $http_host = $_SERVER['HTTP_HOST'];398 399 377 $_SERVER['HTTPS'] = 'on'; 400 378 … … 405 383 // Test that wp_get_attachemt_url returns with https scheme. 406 384 $url = wp_get_attachment_url( $attachment_id ); 407 408 // Cleanup.409 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off';410 $_SERVER['HTTP_HOST'] = $http_host;411 385 412 386 $this->assertSame( 'https', parse_url( $url, PHP_URL_SCHEME ) ); … … 429 403 $attachment_id = $this->_make_attachment( $upload ); 430 404 431 $is_ssl = is_ssl();432 405 $_SERVER['HTTPS'] = 'on'; 433 406 set_current_screen( 'dashboard' ); … … 436 409 437 410 // Cleanup. 438 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off';439 411 set_current_screen( 'front' ); 440 412 … … 458 430 $attachment_id = $this->_make_attachment( $upload ); 459 431 460 $is_ssl = is_ssl();461 432 $_SERVER['HTTPS'] = 'on'; 462 433 set_current_screen( 'dashboard' ); … … 465 436 466 437 // Cleanup. 467 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off';468 438 set_current_screen( 'front' ); 469 439 remove_filter( 'upload_dir', '_upload_dir_https' );
Note: See TracChangeset
for help on using the changeset viewer.