Remove the failing test_rest_url_scheme()
test while it's investigated.
See #34299 git-svn-id: https://develop.svn.wordpress.org/trunk@35344 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bdffdf0eb6
commit
289973f078
@ -254,61 +254,4 @@ class Tests_REST_API extends WP_UnitTestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 34299
|
||||
*/
|
||||
public function test_rest_url_scheme() {
|
||||
if ( isset( $_SERVER['HTTPS'] ) ) {
|
||||
$_https = $_SERVER['HTTPS'];
|
||||
}
|
||||
if ( isset( $_SERVER['SERVER_NAME'] ) ) {
|
||||
$_name = $_SERVER['SERVER_NAME'];
|
||||
}
|
||||
$_SERVER['SERVER_NAME'] = parse_url( home_url(), PHP_URL_HOST );
|
||||
$_siteurl = get_option( 'siteurl' );
|
||||
|
||||
// Test an HTTP URL
|
||||
unset( $_SERVER['HTTPS'] );
|
||||
$url = get_rest_url();
|
||||
$this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) );
|
||||
|
||||
// Test an HTTPS URL
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
$url = get_rest_url();
|
||||
$this->assertSame( 'https', parse_url( $url, PHP_URL_SCHEME ) );
|
||||
|
||||
// Switch to an admin request on a different domain name
|
||||
$_SERVER['SERVER_NAME'] = 'admin.example.org';
|
||||
update_option( 'siteurl', 'http://admin.example.org' );
|
||||
$this->assertNotEquals( $_SERVER['SERVER_NAME'], parse_url( home_url(), PHP_URL_HOST ) );
|
||||
|
||||
set_current_screen( 'edit.php' );
|
||||
$this->assertTrue( is_admin() );
|
||||
|
||||
// Test an HTTP URL
|
||||
unset( $_SERVER['HTTPS'] );
|
||||
$url = get_rest_url();
|
||||
$this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) );
|
||||
|
||||
// Test an HTTPS URL
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
$url = get_rest_url();
|
||||
$this->assertSame( 'http', parse_url( $url, PHP_URL_SCHEME ) );
|
||||
|
||||
// Reset
|
||||
if ( isset( $_https ) ) {
|
||||
$_SERVER['HTTPS'] = $_https;
|
||||
} else {
|
||||
unset( $_SERVER['HTTPS'] );
|
||||
}
|
||||
if ( isset( $_name ) ) {
|
||||
$_SERVER['SERVER_NAME'] = $_name;
|
||||
} else {
|
||||
unset( $_SERVER['SERVER_NAME'] );
|
||||
}
|
||||
update_option( 'siteurl', $_siteurl );
|
||||
set_current_screen( 'front' );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user