Changeset 36711 for trunk/tests/phpunit/tests/post/attachments.php
- Timestamp:
- 02/25/2016 09:17:34 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/attachments.php
r36565 r36711 302 302 303 303 $url = wp_get_attachment_url( $attachment_id ); 304 $this->assertSame( set_url_scheme( $url, 'http' ), $url );305 304 306 305 // Cleanup. 307 306 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off'; 307 308 $this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) ); 308 309 } 309 310 … … 331 332 332 333 $url = wp_get_attachment_url( $attachment_id ); 333 $this->assertSame( set_url_scheme( $url, 'http' ), $url );334 334 335 335 // Cleanup. 336 336 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off'; 337 338 $this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) ); 337 339 } 338 340 … … 361 363 $_SERVER['HTTPS'] = 'on'; 362 364 363 // Verifythat server host matches the host of wp_upload_dir().365 // Ensure that server host matches the host of wp_upload_dir(). 364 366 $upload_dir = wp_upload_dir(); 365 367 $_SERVER['HTTP_HOST'] = parse_url( $upload_dir['baseurl'], PHP_URL_HOST ); … … 367 369 // Test that wp_get_attachemt_url returns with https scheme. 368 370 $url = wp_get_attachment_url( $attachment_id ); 369 $this->assertSame( set_url_scheme( $url, 'https' ), $url );370 371 371 372 // Cleanup. 372 373 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off'; 373 374 $_SERVER['HTTP_HOST'] = $http_host; 375 376 $this->assertSame( 'https', parse_url( $url, PHP_URL_SCHEME ) ); 374 377 } 375 378 … … 396 399 $_SERVER['HTTPS'] = 'on'; 397 400 398 // Verifythat server host matches the host of wp_upload_dir().401 // Ensure that server host matches the host of wp_upload_dir(). 399 402 $upload_dir = wp_upload_dir(); 400 403 $_SERVER['HTTP_HOST'] = parse_url( $upload_dir['baseurl'], PHP_URL_HOST ); … … 402 405 // Test that wp_get_attachemt_url returns with https scheme. 403 406 $url = wp_get_attachment_url( $attachment_id ); 404 $this->assertSame( set_url_scheme( $url, 'https' ), $url );405 407 406 408 // Cleanup. 407 409 $_SERVER['HTTPS'] = $is_ssl ? 'on' : 'off'; 408 410 $_SERVER['HTTP_HOST'] = $http_host; 411 412 $this->assertSame( 'https', parse_url( $url, PHP_URL_SCHEME ) ); 409 413 } 410 414 … … 465 469 remove_filter( 'upload_dir', '_upload_dir_https' ); 466 470 467 $this->assertSame( set_url_scheme( $url, 'https' ), $url);471 $this->assertSame( 'https', parse_url( $url, PHP_URL_SCHEME ) ); 468 472 } 469 473
Note: See TracChangeset
for help on using the changeset viewer.