Skip to content

Commit

Permalink
Merge pull request #754 from TimothyBJacobs/patch-2
Browse files Browse the repository at this point in the history
Correctly type REST API Test Case docs
  • Loading branch information
lucatume authored Sep 10, 2024
2 parents 145e234 + abafba0 commit 5528232
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
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

0 comments on commit 5528232

Please sign in to comment.