Changeset 39594 for trunk/tests/phpunit/tests/rest-api/rest-request.php
- Timestamp:
- 12/13/2016 03:33:14 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-request.php
r39563 r39594 11 11 */ 12 12 class Tests_REST_Request extends WP_UnitTestCase { 13 public $request; 14 13 15 public function setUp() { 14 16 parent::setUp(); … … 449 451 $data = $valid->get_error_data(); 450 452 $this->assertEquals( JSON_ERROR_SYNTAX, $data['json_error_code'] ); 453 } 454 455 456 public function test_has_valid_params_empty_json_no_error() { 457 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) { 458 return $this->markTestSkipped( 'JSON validation is only available for PHP 5.3+' ); 459 } 460 461 $this->request->set_header( 'Content-Type', 'application/json' ); 462 $this->request->set_body( '' ); 463 464 $valid = $this->request->has_valid_params(); 465 $this->assertNotWPError( $valid ); 451 466 } 452 467
Note: See TracChangeset
for help on using the changeset viewer.