Changeset 55210 for trunk/tests/phpunit/tests/rest-api/rest-request.php
- Timestamp:
- 02/03/2023 01:33:18 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-request.php
r52235 r55210 204 204 * @dataProvider alternate_json_content_type_provider 205 205 * 206 * @param string $content_type The content-type header.206 * @param string $content_type The Content-Type header. 207 207 * @param string $source The source value. 208 208 * @param bool $accept_json The accept_json value. … … 235 235 * @dataProvider is_json_content_type_provider 236 236 * 237 * @param string $content_type The content-type header.237 * @param string $content_type The Content-Type header. 238 238 * @param bool $is_json The is_json value. 239 239 */ … … 243 243 $this->request->set_header( 'Content-Type', $content_type ); 244 244 245 // Check for JSON content-type.245 // Check for JSON Content-Type. 246 246 $this->assertSame( $is_json, $this->request->is_json_content_type() ); 247 247 } … … 362 362 363 363 $this->request->set_method( 'PUT' ); 364 $this->request->add_header( ' content-type', 'application/json' );364 $this->request->add_header( 'Content-Type', 'application/json' ); 365 365 $this->request->set_body( wp_json_encode( $data ) ); 366 366 … … 384 384 385 385 $this->request->set_method( 'POST' ); 386 $this->request->add_header( ' content-type', 'application/json' );386 $this->request->add_header( 'Content-Type', 'application/json' ); 387 387 $this->request->set_body( wp_json_encode( $data ) ); 388 388 … … 865 865 public function test_set_param_follows_parameter_order() { 866 866 $request = new WP_REST_Request(); 867 $request->add_header( ' content-type', 'application/json' );867 $request->add_header( 'Content-Type', 'application/json' ); 868 868 $request->set_method( 'POST' ); 869 869 $request->set_body( … … 893 893 public function test_set_param_updates_param_in_json_and_query() { 894 894 $request = new WP_REST_Request(); 895 $request->add_header( ' content-type', 'application/json' );895 $request->add_header( 'Content-Type', 'application/json' ); 896 896 $request->set_method( 'POST' ); 897 897 $request->set_body( … … 920 920 public function test_set_param_updates_param_if_already_exists_in_query() { 921 921 $request = new WP_REST_Request(); 922 $request->add_header( ' content-type', 'application/json' );922 $request->add_header( 'Content-Type', 'application/json' ); 923 923 $request->set_method( 'POST' ); 924 924 $request->set_body( … … 954 954 public function test_set_param_to_null_updates_param_in_json_and_query() { 955 955 $request = new WP_REST_Request(); 956 $request->add_header( ' content-type', 'application/json' );956 $request->add_header( 'Content-Type', 'application/json' ); 957 957 $request->set_method( 'POST' ); 958 958 $request->set_body( … … 981 981 public function test_set_param_from_null_updates_param_in_json_and_query_with_null() { 982 982 $request = new WP_REST_Request(); 983 $request->add_header( ' content-type', 'application/json' );983 $request->add_header( 'Content-Type', 'application/json' ); 984 984 $request->set_method( 'POST' ); 985 985 $request->set_body( … … 1008 1008 public function test_set_param_with_invalid_json() { 1009 1009 $request = new WP_REST_Request(); 1010 $request->add_header( ' content-type', 'application/json' );1010 $request->add_header( 'Content-Type', 'application/json' ); 1011 1011 $request->set_method( 'POST' ); 1012 1012 $request->set_body( '' );
Note: See TracChangeset
for help on using the changeset viewer.