You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
Im using the API to create some terms (POST /wp-json/wp/v2/terms/...), and I noticed it returns 200, while other endpoints (such as creating a post) return the correct 201/CREATED.
From test-rest-terms-controller.php:
publicfunctiontest_create_item() {
wp_set_current_user( $this->administrator );
$request = newWP_REST_Request( 'POST', '/wp/v2/terms/category' );
$request->set_param( 'name', 'My Awesome Term' );
$request->set_param( 'description', 'This term is so awesome.' );
$request->set_param( 'slug', 'so-awesome' );
$response = $this->server->dispatch( $request );
$this->assertEquals( 200, $response->get_status() ); // <----- wrong status code$data = $response->get_data();
$this->assertEquals( 'My Awesome Term', $data['name'] );
$this->assertEquals( 'This term is so awesome.', $data['description'] );
$this->assertEquals( 'so-awesome', $data['slug'] );
}