From bbb91ebd5477134a672b45718ecd120ed2d739c7 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 17 Jul 2024 09:56:06 +0200 Subject: [PATCH] Generate stubs for WordPress Tests 6.6.0 --- VERSION | 2 +- wordpress-tests-stubs.php | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index cc81d71..826f5ce 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.5.5 +6.6.0 diff --git a/wordpress-tests-stubs.php b/wordpress-tests-stubs.php index 9a92f0f..dd0cf0b 100644 --- a/wordpress-tests-stubs.php +++ b/wordpress-tests-stubs.php @@ -801,7 +801,7 @@ protected function update_post_modified($post_id, $date) /** * Touches the given file and its directory if it doesn't already exist. * - * This can be used to ensure a file that is implictly relied on in a test exists + * This can be used to ensure a file that is implicitly relied on in a test exists * without it having to be built. * * @param string $file The file name. @@ -1428,7 +1428,7 @@ public function create_many($count, $args = array(), $generation_definitions = \ * @param array|null $callbacks Optional. Array with callbacks to apply on the fields. * Default null. * - * @return array|WP_Error Combined array on success. WP_Error when default value is incorrent. + * @return array|WP_Error Combined array on success. WP_Error when default value is incorrect. */ public function generate_args($args = array(), $generation_definitions = \null, &$callbacks = \null) { @@ -2372,7 +2372,7 @@ public static function set_up_before_class() /** * Sets up the test fixture. * - * Overrides wp_die(), pretends to be Ajax, and suppresses E_WARNINGs. + * Overrides wp_die(), pretends to be Ajax, and suppresses warnings. */ public function set_up() { @@ -2517,7 +2517,18 @@ public function get_canonical($test_url) } abstract class WP_Test_REST_TestCase extends \WP_UnitTestCase { - protected function assertErrorResponse($code, $response, $status = \null) + /** + * Asserts that the REST API response has the specified error. + * + * @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. + */ + protected function assertErrorResponse($code, $response, $status = \null, $message = '') { } }