REST API: Unit test for OPTIONS request should call rest_send_allow_header

In [36829] we moved this logic to rest_send_allow_header()

See #36829.


git-svn-id: https://develop.svn.wordpress.org/trunk@36831 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Hoyle 2016-03-03 11:37:48 +00:00
parent 090e49fe74
commit fc0ed5e1ca
1 changed files with 3 additions and 3 deletions

View File

@ -245,11 +245,11 @@ class Tests_REST_API extends WP_UnitTestCase {
$request = new WP_REST_Request( 'OPTIONS', '/test-ns/test' ); $request = new WP_REST_Request( 'OPTIONS', '/test-ns/test' );
$response = rest_handle_options_request( null, $GLOBALS['wp_rest_server'], $request ); $response = rest_handle_options_request( null, $GLOBALS['wp_rest_server'], $request );
$response = rest_send_allow_header( $response, $GLOBALS['wp_rest_server'], $request );
$headers = $response->get_headers(); $headers = $response->get_headers();
$this->assertArrayHasKey( 'Accept', $headers ); $this->assertArrayHasKey( 'Allow', $headers );
$this->assertEquals( 'GET, POST', $headers['Accept'] ); $this->assertEquals( 'GET, POST', $headers['Allow'] );
} }
/** /**