From cb92a177a00fd0aa10ccc3ac810f75baf7237536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Wed, 17 Jun 2026 16:47:21 +0200 Subject: [PATCH 1/4] Refactor parameter descriptions in test methods for clarity and consistency --- tests/phpunit/tests/admin/includesFile.php | 2 +- tests/phpunit/tests/dependencies/scripts.php | 1 - .../tests/filesystem/wpFilesystemDirect/delete.php | 2 +- .../phpunit/tests/filesystem/wpFilesystemDirect/isDir.php | 2 -- tests/phpunit/tests/functions/allowedProtocols.php | 4 ++-- tests/phpunit/tests/functions/doEnclose.php | 2 +- tests/phpunit/tests/image/meta.php | 4 ++-- tests/phpunit/tests/multisite/updateBlogDetails.php | 2 +- tests/phpunit/tests/post.php | 2 -- .../privacy/wpPrivacyProcessPersonalDataExportPage.php | 8 ++++---- .../phpunit/tests/rest-api/rest-block-type-controller.php | 2 -- tests/phpunit/tests/rest-api/rest-comments-controller.php | 2 +- tests/phpunit/tests/rest-api/rest-search-controller.php | 2 -- .../rest-api/wpRestBlockPatternCategoriesController.php | 2 -- tests/phpunit/tests/rewrite.php | 2 +- 15 files changed, 14 insertions(+), 25 deletions(-) diff --git a/tests/phpunit/tests/admin/includesFile.php b/tests/phpunit/tests/admin/includesFile.php index ab2e82cf1dc8e..78388b22534f9 100644 --- a/tests/phpunit/tests/admin/includesFile.php +++ b/tests/phpunit/tests/admin/includesFile.php @@ -400,7 +400,7 @@ public function mock_http_request( $response, $parsed_args, $url ) { * @ticket 54738 * * @param string $filter A callback containing a fake Content-Type header. - * @param string $ext The expected file extension to match. + * @param string $extension The expected file extension to match. */ public function test_download_url_should_use_the_content_type_header_to_set_extension_of_a_file_if_extension_was_not_determined( $filter, $extension ) { add_filter( 'pre_http_request', $filter ); diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php index 41c9673915b93..9783308c1cec9 100644 --- a/tests/phpunit/tests/dependencies/scripts.php +++ b/tests/phpunit/tests/dependencies/scripts.php @@ -558,7 +558,6 @@ public function get_data_to_filter_eligible_strategies() { * @dataProvider get_data_to_filter_eligible_strategies * * @param callable $set_up Set up. - * @param bool $async_only Async only. * @param bool $expected Expected return value. */ public function test_filter_eligible_strategies( $set_up, $expected ) { diff --git a/tests/phpunit/tests/filesystem/wpFilesystemDirect/delete.php b/tests/phpunit/tests/filesystem/wpFilesystemDirect/delete.php index 4afe54890a5f3..3cee4294673ff 100644 --- a/tests/phpunit/tests/filesystem/wpFilesystemDirect/delete.php +++ b/tests/phpunit/tests/filesystem/wpFilesystemDirect/delete.php @@ -69,7 +69,7 @@ public function test_should_delete_a_directory_with_contents() { * * @dataProvider data_should_delete_a_file * - * @param string $key The key for the file in `self::$filesystem_structure`. + * @param string $file The key for the file in `self::$filesystem_structure`. */ public function test_should_delete_a_file( $file ) { $file = self::$file_structure[ $file ]['path'] . $file; diff --git a/tests/phpunit/tests/filesystem/wpFilesystemDirect/isDir.php b/tests/phpunit/tests/filesystem/wpFilesystemDirect/isDir.php index 1a367851f6a78..c23e301485c15 100644 --- a/tests/phpunit/tests/filesystem/wpFilesystemDirect/isDir.php +++ b/tests/phpunit/tests/filesystem/wpFilesystemDirect/isDir.php @@ -35,8 +35,6 @@ public function test_should_determine_that_a_path_is_a_directory() { * @dataProvider data_should_determine_that_a_path_is_not_a_directory * * @param string $path The path to check. - * @param string $type The type of resource. Accepts 'f' or 'd'. - * Used to invert $expected due to data provider setup. */ public function test_should_determine_that_a_path_is_not_a_directory( $path ) { $this->assertFalse( self::$filesystem->is_dir( self::$file_structure['test_dir']['path'] . $path ) ); diff --git a/tests/phpunit/tests/functions/allowedProtocols.php b/tests/phpunit/tests/functions/allowedProtocols.php index 4d4ecf5320e14..a67be0f0c60ec 100644 --- a/tests/phpunit/tests/functions/allowedProtocols.php +++ b/tests/phpunit/tests/functions/allowedProtocols.php @@ -27,8 +27,8 @@ public function test_allowed_protocol_has_an_example() { * @depends test_allowed_protocol_has_an_example * @dataProvider data_example_urls * - * @param string The scheme. - * @param string Example URL. + * @param string $protocol The scheme. + * @param string $url Example URL. */ public function test_allowed_protocols( $protocol, $url ) { $this->assertSame( $url, esc_url( $url, $protocol ) ); diff --git a/tests/phpunit/tests/functions/doEnclose.php b/tests/phpunit/tests/functions/doEnclose.php index 6d36fd373a779..8cbcec79ccdb6 100644 --- a/tests/phpunit/tests/functions/doEnclose.php +++ b/tests/phpunit/tests/functions/doEnclose.php @@ -221,7 +221,7 @@ public function test_function_enclosure_links_should_be_filterable() { * * @since 5.3.0 * - * @param array $post_links An array of enclosure links. + * @param array $enclosure_links An array of enclosure links. * @param int $post_id Post ID. * @return array An array of enclosure links. */ diff --git a/tests/phpunit/tests/image/meta.php b/tests/phpunit/tests/image/meta.php index babd3a94bb3b8..b6a1849fae9ae 100644 --- a/tests/phpunit/tests/image/meta.php +++ b/tests/phpunit/tests/image/meta.php @@ -184,8 +184,8 @@ public function test_exif_keywords() { * @ticket 52826 * @ticket 52922 * - * @param string Stream's URI. - * @param array Expected metadata. + * @param string $file Stream's URI. + * @param array $expected Expected metadata. */ public function test_stream( $file, $expected ) { $actual = wp_read_image_metadata( $file ); diff --git a/tests/phpunit/tests/multisite/updateBlogDetails.php b/tests/phpunit/tests/multisite/updateBlogDetails.php index 62c0f7b355cd7..078d421dfc520 100644 --- a/tests/phpunit/tests/multisite/updateBlogDetails.php +++ b/tests/phpunit/tests/multisite/updateBlogDetails.php @@ -53,7 +53,7 @@ public function test_update_blog_details() { * * @param string $flag The name of the flag being set or unset on a site. * @param string $flag_value '0' or '1'. The value of the flag being set. - * @param string $action The hook expected to fire for the flag name and flag combination. + * @param string $hook The hook expected to fire for the flag name and flag combination. * * @dataProvider data_flag_hooks */ diff --git a/tests/phpunit/tests/post.php b/tests/phpunit/tests/post.php index e609fa0d3003d..842502a971cba 100644 --- a/tests/phpunit/tests/post.php +++ b/tests/phpunit/tests/post.php @@ -668,8 +668,6 @@ public function data_stick_post_with_unexpected_sticky_posts_option() { * * @ticket 52007 * @covers ::stick_post - * - * @param mixed $stick Value to pass to stick_post(). */ public function test_stick_post_removes_duplicate_post_ids_when_adding_new_value() { update_option( 'sticky_posts', array( 1, 1, 2, 2 ) ); diff --git a/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php b/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php index 5410f851f4b2a..113357113587d 100644 --- a/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php +++ b/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php @@ -358,7 +358,7 @@ public function data_send_as_email_options() { * * @dataProvider data_send_as_email_options * - * @param bool Whether the final results of the export should be emailed to the user. + * @param bool $send_as_email Whether the final results of the export should be emailed to the user. */ public function test_send_error_when_invalid_request_id( $send_as_email ) { $response = array( @@ -388,7 +388,7 @@ public function test_send_error_when_invalid_request_id( $send_as_email ) { * * @dataProvider data_send_as_email_options * - * @param bool Whether the final results of the export should be emailed to the user. + * @param bool $send_as_email Whether the final results of the export should be emailed to the user. */ public function test_send_error_when_invalid_request_action_name( $send_as_email ) { $response = array( @@ -420,7 +420,7 @@ public function test_send_error_when_invalid_request_action_name( $send_as_email * * @dataProvider data_send_as_email_options * - * @param bool Whether the final results of the export should be emailed to the user. + * @param bool $send_as_email Whether the final results of the export should be emailed to the user. * */ public function test_raw_data_post_meta( $send_as_email ) { @@ -461,7 +461,7 @@ public function test_raw_data_post_meta( $send_as_email ) { * * @dataProvider data_send_as_email_options * - * @param bool Whether the final results of the export should be emailed to the user. + * @param bool $send_as_email Whether the final results of the export should be emailed to the user. */ public function test_add_post_meta_with_groups_data_only_available_when_export_file_generated( $send_as_email ) { // Adds post meta when processing data, given the first exporter on the first page and send as email. diff --git a/tests/phpunit/tests/rest-api/rest-block-type-controller.php b/tests/phpunit/tests/rest-api/rest-block-type-controller.php index 7ba693286c993..95af2ad75c436 100644 --- a/tests/phpunit/tests/rest-api/rest-block-type-controller.php +++ b/tests/phpunit/tests/rest-api/rest-block-type-controller.php @@ -753,8 +753,6 @@ public function test_get_item_no_permission( $method ) { * @dataProvider data_readable_http_methods * @ticket 47620 * @ticket 56481 - * - * @param string $method HTTP method to use. */ public function test_prepare_item() { $registry = new WP_Block_Type_Registry(); diff --git a/tests/phpunit/tests/rest-api/rest-comments-controller.php b/tests/phpunit/tests/rest-api/rest-comments-controller.php index 547757ae6042e..f089539990551 100644 --- a/tests/phpunit/tests/rest-api/rest-comments-controller.php +++ b/tests/phpunit/tests/rest-api/rest-comments-controller.php @@ -3646,7 +3646,7 @@ public static function data_head_request_with_specified_fields_returns_success_r /** * Create a test post with note. * - * @param int $user_id Post author's user ID. + * @param string $role User role to assign the post author. * @return int Post ID. */ protected function create_test_post_with_note( $role ) { diff --git a/tests/phpunit/tests/rest-api/rest-search-controller.php b/tests/phpunit/tests/rest-api/rest-search-controller.php index e4235fd699798..96d73976fb4c0 100644 --- a/tests/phpunit/tests/rest-api/rest-search-controller.php +++ b/tests/phpunit/tests/rest-api/rest-search-controller.php @@ -357,8 +357,6 @@ public function test_get_items_search_type_invalid( $method ) { * * @dataProvider data_readable_http_methods * @ticket 56481 - * - * @param string $method HTTP method to use. */ public function test_get_items_search_type_post_subtype_invalid() { $response = $this->do_request_with_params( diff --git a/tests/phpunit/tests/rest-api/wpRestBlockPatternCategoriesController.php b/tests/phpunit/tests/rest-api/wpRestBlockPatternCategoriesController.php index 408021b039d31..8962b330a2a9d 100644 --- a/tests/phpunit/tests/rest-api/wpRestBlockPatternCategoriesController.php +++ b/tests/phpunit/tests/rest-api/wpRestBlockPatternCategoriesController.php @@ -141,8 +141,6 @@ public function test_get_items_with_head_request_should_not_prepare_block_patter /** * @ticket 56481 - * - * @param string $path The path to test. */ public function test_head_request_with_specified_fields_returns_success_response() { wp_set_current_user( self::$admin_id ); diff --git a/tests/phpunit/tests/rewrite.php b/tests/phpunit/tests/rewrite.php index 2bb7254abfcef..24c7e4e1459fc 100644 --- a/tests/phpunit/tests/rewrite.php +++ b/tests/phpunit/tests/rewrite.php @@ -167,7 +167,7 @@ public function test_url_to_postid_of_http_site_when_current_site_uses_https() { * @param string $url The complete home URL including scheme and path. * @param string $path Path relative to the home URL. Blank string if no path is specified. * @param string|null $orig_scheme Scheme to give the home URL context. - * @param int|null $blog_id Site ID, or null for the current site. + * @param int|null $_blog_id Site ID, or null for the current site. * @return string The complete home URL including scheme and path. */ public function filter_http_home_url( $url, $path, $orig_scheme, $_blog_id ) { From beceb99319edfd89ac003ed13bc1f732002a8d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Wed, 17 Jun 2026 16:50:35 +0200 Subject: [PATCH 2/4] Refactor parameter descriptions in test methods for clarity and consistency --- tests/phpunit/tests/admin/includesFile.php | 2 +- tests/phpunit/tests/functions/doEnclose.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/admin/includesFile.php b/tests/phpunit/tests/admin/includesFile.php index 78388b22534f9..fa16bfc261ade 100644 --- a/tests/phpunit/tests/admin/includesFile.php +++ b/tests/phpunit/tests/admin/includesFile.php @@ -399,7 +399,7 @@ public function mock_http_request( $response, $parsed_args, $url ) { * @covers ::download_url * @ticket 54738 * - * @param string $filter A callback containing a fake Content-Type header. + * @param string $filter A callback containing a fake Content-Type header. * @param string $extension The expected file extension to match. */ public function test_download_url_should_use_the_content_type_header_to_set_extension_of_a_file_if_extension_was_not_determined( $filter, $extension ) { diff --git a/tests/phpunit/tests/functions/doEnclose.php b/tests/phpunit/tests/functions/doEnclose.php index 8cbcec79ccdb6..425b28c9dd6d0 100644 --- a/tests/phpunit/tests/functions/doEnclose.php +++ b/tests/phpunit/tests/functions/doEnclose.php @@ -222,7 +222,7 @@ public function test_function_enclosure_links_should_be_filterable() { * @since 5.3.0 * * @param array $enclosure_links An array of enclosure links. - * @param int $post_id Post ID. + * @param int $post_id Post ID. * @return array An array of enclosure links. */ public function filter_enclosure_links( $enclosure_links, $post_id ) { From 64da9b1c4d3674483022f58d797fdef958a21669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Thu, 18 Jun 2026 13:46:05 +0200 Subject: [PATCH 3/4] Update tests/phpunit/tests/functions/allowedProtocols.php Co-authored-by: Mukesh Panchal --- tests/phpunit/tests/functions/allowedProtocols.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions/allowedProtocols.php b/tests/phpunit/tests/functions/allowedProtocols.php index a67be0f0c60ec..63ca3ab0945ce 100644 --- a/tests/phpunit/tests/functions/allowedProtocols.php +++ b/tests/phpunit/tests/functions/allowedProtocols.php @@ -28,7 +28,7 @@ public function test_allowed_protocol_has_an_example() { * @dataProvider data_example_urls * * @param string $protocol The scheme. - * @param string $url Example URL. + * @param string $url Example URL. */ public function test_allowed_protocols( $protocol, $url ) { $this->assertSame( $url, esc_url( $url, $protocol ) ); From f7b3c1d60a76352bf03d6981751f23144791bcb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Thu, 18 Jun 2026 13:49:09 +0200 Subject: [PATCH 4/4] Fix --- tests/phpunit/tests/dependencies/scripts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php index 9783308c1cec9..683c0df2e6226 100644 --- a/tests/phpunit/tests/dependencies/scripts.php +++ b/tests/phpunit/tests/dependencies/scripts.php @@ -557,8 +557,8 @@ public function get_data_to_filter_eligible_strategies() { * * @dataProvider get_data_to_filter_eligible_strategies * - * @param callable $set_up Set up. - * @param bool $expected Expected return value. + * @param callable $set_up Set up. + * @param bool $expected Expected return value. */ public function test_filter_eligible_strategies( $set_up, $expected ) { $handle = $set_up();