Skip to content

Commit

Permalink
fix: Duplicate request methods in DokanTestCase class (#2363)
Browse files Browse the repository at this point in the history
  • Loading branch information
mralaminahamed authored Sep 5, 2024
1 parent d91d51e commit 616b620
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions tests/php/src/DokanTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,40 +268,6 @@ protected function put_request( string $route, array $params = [], array $header
return $this->server->dispatch( $request );
}

/**
* Perform a DELETE request on the given route with parameters.
*
* @param string $route The REST API route.
* @param array $params Optional body parameters.
* @param array $headers Optional headers.
* @param bool $header_override Optional header override status.
* @return WP_REST_Response The response object.
*/
protected function delete_request( string $route, array $params = [], array $headers = [], bool $header_override = true ): WP_REST_Response {
$request = new WP_REST_Request( 'DELETE', $this->get_route( $route ) );
$request->set_body_params( $params );
$request->set_headers( $headers, $header_override );

return $this->server->dispatch( $request );
}

/**
* Perform a PUT request on the given route with parameters.
*
* @param string $route The REST API route.
* @param array $params Optional body parameters.
* @param array $headers Optional headers.
* @param bool $header_override Optional header override status.
* @return WP_REST_Response The response object.
*/
protected function put_request( string $route, array $params = [], array $headers = [], bool $header_override = true ): WP_REST_Response {
$request = new WP_REST_Request( 'PUT', $this->get_route( $route ) );
$request->set_body_params( $params );
$request->set_headers( $headers, $header_override );

return $this->server->dispatch( $request );
}

/**
* Data provider for multi-vendor order.
*
Expand Down

0 comments on commit 616b620

Please sign in to comment.