Changeset 51960 for trunk/tests/phpunit/tests/rest-api/rest-server.php
- Timestamp:
- 10/31/2021 06:06:02 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-server.php
r51657 r51960 2023 2023 } 2024 2024 2025 /** 2026 * @ticket 53056 2027 */ 2028 public function test_json_encode_error_results_in_500_status_code() { 2029 register_rest_route( 2030 'test-ns/v1', 2031 '/test', 2032 array( 2033 array( 2034 'methods' => \WP_REST_Server::READABLE, 2035 'callback' => function() { 2036 return new \WP_REST_Response( INF ); 2037 }, 2038 'permission_callback' => '__return_true', 2039 'args' => array(), 2040 ), 2041 ) 2042 ); 2043 rest_get_server()->serve_request( '/test-ns/v1/test' ); 2044 $this->assertSame( 500, rest_get_server()->status ); 2045 } 2046 2025 2047 public function _validate_as_integer_123( $value, $request, $key ) { 2026 2048 if ( ! is_int( $value ) ) {
Note: See TracChangeset
for help on using the changeset viewer.