REST API: Use WP_REST_Request::from_url() when embedding.

See #35803.


git-svn-id: https://develop.svn.wordpress.org/trunk@36674 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan McCue
2016-02-24 04:19:44 +00:00
parent 92d2be6a3d
commit c3c445c0c9
2 changed files with 11 additions and 23 deletions

View File

@@ -492,7 +492,9 @@ class Tests_REST_Server extends WP_Test_REST_TestCase {
) );
$response = new WP_REST_Response();
$response->add_link( 'alternate', rest_url( '/test/embeddable?parsed_params=yes' ), array( 'embeddable' => true ) );
$url = rest_url( '/test/embeddable' );
$url = add_query_arg( 'parsed_params', 'yes', $url );
$response->add_link( 'alternate', $url, array( 'embeddable' => true ) );
$data = $this->server->response_to_data( $response, true );
@@ -514,7 +516,9 @@ class Tests_REST_Server extends WP_Test_REST_TestCase {
) );
$response = new WP_REST_Response();
$response->add_link( 'up', rest_url( '/test/embeddable?error=1' ), array( 'embeddable' => true ) );
$url = rest_url( '/test/embeddable' );
$url = add_query_arg( 'error', '1', $url );
$response->add_link( 'up', $url, array( 'embeddable' => true ) );
$data = $this->server->response_to_data( $response, true );