- Timestamp:
- 02/03/2023 01:33:18 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php
r55154 r55210 312 312 313 313 $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' ); 314 $request->add_header( ' content-type', 'application/x-www-form-urlencoded' );314 $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' ); 315 315 316 316 $params = $this->set_post_data( … … 328 328 wp_set_current_user( self::$editor_id ); 329 329 $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' ); 330 $request->add_header( ' content-type', 'application/x-www-form-urlencoded' );330 $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' ); 331 331 332 332 $params = $this->set_post_data( … … 347 347 348 348 $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' ); 349 $request->add_header( ' content-type', 'application/x-www-form-urlencoded' );349 $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' ); 350 350 351 351 $params = $this->set_post_data( … … 366 366 367 367 $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' ); 368 $request->add_header( ' content-type', 'application/json' );368 $request->add_header( 'Content-Type', 'application/json' ); 369 369 370 370 $current_post = get_post( self::$post_id ); … … 413 413 414 414 $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' ); 415 $request->add_header( ' content-type', 'application/json' );415 $request->add_header( 'Content-Type', 'application/json' ); 416 416 $request->set_body( wp_json_encode( $autosave_data ) ); 417 417 … … 452 452 453 453 $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' ); 454 $request->add_header( ' content-type', 'application/json' );454 $request->add_header( 'Content-Type', 'application/json' ); 455 455 $request->set_body( wp_json_encode( $autosave_data ) ); 456 456 … … 573 573 wp_set_current_user( self::$editor_id ); 574 574 $request = new WP_REST_Request( 'POST', '/wp/v2/pages/' . self::$child_draft_page_id . '/autosaves' ); 575 $request->add_header( ' content-type', 'application/x-www-form-urlencoded' );575 $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' ); 576 576 577 577 $params = $this->set_post_data( … … 594 594 595 595 $request = new WP_REST_Request( 'POST', '/wp/v2/pages/' . self::$draft_page_id . '/autosaves' ); 596 $request->add_header( ' content-type', 'application/x-www-form-urlencoded' );596 $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' ); 597 597 598 598 $params = $this->set_post_data( … … 649 649 // Initiate an autosave via the REST API as Gutenberg does. 650 650 $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . self::$post_id . '/autosaves' ); 651 $request->add_header( ' content-type', 'application/json' );651 $request->add_header( 'Content-Type', 'application/json' ); 652 652 $request->set_body( wp_json_encode( $autosave_data ) ); 653 653 … … 700 700 // Create autosaves response. 701 701 $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . $post_id . '/autosaves' ); 702 $request->add_header( ' content-type', 'application/json' );702 $request->add_header( 'Content-Type', 'application/json' ); 703 703 $request->set_body( wp_json_encode( $autosave_data ) ); 704 704
Note: See TracChangeset
for help on using the changeset viewer.