- Timestamp:
- 12/16/2016 05:42:23 AM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/tests/phpunit/tests/rest-api/rest-request.php
r39109 r39609 11 11 */ 12 12 class Tests_REST_Request extends WP_UnitTestCase { 13 public $request; 14 13 15 public function setUp() { 14 16 parent::setUp(); … … 413 415 $data = $valid->get_error_data(); 414 416 $this->assertEquals( JSON_ERROR_SYNTAX, $data['json_error_code'] ); 417 } 418 419 420 public function test_has_valid_params_empty_json_no_error() { 421 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) { 422 return $this->markTestSkipped( 'JSON validation is only available for PHP 5.3+' ); 423 } 424 425 $this->request->set_header( 'Content-Type', 'application/json' ); 426 $this->request->set_body( '' ); 427 428 $valid = $this->request->has_valid_params(); 429 $this->assertNotWPError( $valid ); 415 430 } 416 431
Note: See TracChangeset
for help on using the changeset viewer.