Skip to content

Correctly type REST API Test Case docs #754

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

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
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
17 changes: 16 additions & 1 deletion config/patches/core-phpunit/includes/testcase-rest-api.php.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/includes/core-phpunit/includes/testcase-rest-api.php b/includes/core-phpunit/includes/testcase-rest-api.php
index 27349809..2107abfc 100644
index 99dd5e30..e9005563 100644
--- a/includes/core-phpunit/includes/testcase-rest-api.php
+++ b/includes/core-phpunit/includes/testcase-rest-api.php
@@ -1,6 +1,8 @@
Expand All @@ -12,3 +12,18 @@ index 27349809..2107abfc 100644

/**
* Asserts that the REST API response has the specified error.
@@ -8,10 +10,10 @@ abstract class WP_Test_REST_TestCase extends WP_UnitTestCase {
* @since 4.4.0
* @since 6.6.0 Added the `$message` parameter.
*
- * @param string|int $code Expected error code.
- * @param WP_REST_Response|WP_Error $response REST API response.
- * @param int $status Optional. Status code.
- * @param string $message Optional. Message to display when the assertion fails.
+ * @param string|int $code Expected error code.
+ * @param \WP_REST_Response|\WP_Error $response REST API response.
+ * @param int $status Optional. Status code.
+ * @param string $message Optional. Message to display when the assertion fails.
*/
protected function assertErrorResponse( $code, $response, $status = null, $message = '' ) {

8 changes: 4 additions & 4 deletions includes/core-phpunit/includes/testcase-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ abstract class WPRestApiTestCase extends WPTestCase {
* @since 4.4.0
* @since 6.6.0 Added the `$message` parameter.
*
* @param string|int $code Expected error code.
* @param WP_REST_Response|WP_Error $response REST API response.
* @param int $status Optional. Status code.
* @param string $message Optional. Message to display when the assertion fails.
* @param string|int $code Expected error code.
* @param \WP_REST_Response|\WP_Error $response REST API response.
* @param int $status Optional. Status code.
* @param string $message Optional. Message to display when the assertion fails.
*/
protected function assertErrorResponse( $code, $response, $status = null, $message = '' ) {

Expand Down
Loading