- Timestamp:
- 11/03/2016 02:17:39 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php
r39047 r39105 96 96 $this->assertEquals( 1, count( $data ) ); 97 97 $this->assertEquals( $id2, $data[0]['id'] ); 98 // Invalid parent should fail 99 $request->set_param( 'parent', 'some-slug' ); 100 $response = $this->server->dispatch( $request ); 101 $this->assertErrorResponse( 'rest_invalid_param', $response, 400 ); 98 102 } 99 103 … … 130 134 $this->assertEquals( 1, count( $data ) ); 131 135 $this->assertEquals( $id1, $data[0]['id'] ); 136 // Invalid parent_exclude should error 137 $request->set_param( 'parent_exclude', 'some-slug' ); 138 $response = $this->server->dispatch( $request ); 139 $this->assertErrorResponse( 'rest_invalid_param', $response, 400 ); 132 140 } 133 141 … … 157 165 $this->assertEquals( $id2, $data[2]['id'] ); 158 166 $this->assertEquals( $id3, $data[3]['id'] ); 167 // Invalid menu_order should fail 168 $request = new WP_REST_Request( 'GET', '/wp/v2/pages' ); 169 $request->set_param( 'menu_order', 'top-first' ); 170 $response = $this->server->dispatch( $request ); 171 $this->assertErrorResponse( 'rest_invalid_param', $response, 400 ); 159 172 } 160 173
Note: See TracChangeset
for help on using the changeset viewer.