Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: duplicate test methods in DokanTestCase.php #2382

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading