Tests: Improve the @group annotation accuracy and consistency.

Includes removing `.php` from some older group names, because most of the groups are no longer named based on the file containing the function, and sometimes functions move around, making the file-based group name inaccurate.

Props afercia, aristath, poena, SergeyBiryukov.
See #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@56971 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-10-19 13:51:04 +00:00
parent 6528d9840b
commit 2a6b527f73
114 changed files with 183 additions and 89 deletions
@@ -1,5 +1,6 @@
<?php
/**
* @group admin
* @group themes
*/
class Tests_Admin_IncludesTheme extends WP_UnitTestCase {
@@ -1,6 +1,7 @@
<?php
/**
* @group admin
* @group upgrade
*
* @covers WP_Automatic_Updater
@@ -1,6 +1,7 @@
<?php
/**
* @group admin
* @group site-health
*
* @coversDefaultClass WP_Site_Health
@@ -1,5 +1,8 @@
<?php
/**
* @group admin
* @group user
*
* @coversDefaultClass WP_User_Search
*/
class Tests_Admin_wpUserSearch extends WP_UnitTestCase {
@@ -2,6 +2,7 @@
/**
* @group admin
* @group user
*
* @covers WP_Users_List_Table
*/
@@ -3,6 +3,8 @@
/**
* Test the block WP_Duotone class.
*
* @group block-supports
*
* @package WordPress
*/
@@ -1,5 +1,6 @@
<?php
/**
* @group blocks
* @group block-templates
*
* @covers ::get_block_templates
@@ -2,6 +2,8 @@
/**
* @group canonical
* @group rewrite
* @group query
*/
class Tests_Canonical_Category extends WP_Canonical_UnitTestCase {
public $structure = '/%category%/%postname%/';
@@ -4,6 +4,7 @@
* @group canonical
* @group rewrite
* @group query
*
* @covers ::strip_fragment_from_url
*/
class Tests_Canonical_StripFragmentFromUrl extends WP_UnitTestCase {
@@ -2,6 +2,7 @@
/**
* @group taxonomy
* @group category
*
* @covers ::category_description
*/
@@ -1,7 +1,7 @@
<?php
/**
* @group taxonomy
* @group category.php
* @group category
*
* @covers ::get_all_category_ids
*/
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
/**
* @group taxonomy
* @group category.php
* @group category
*
* @covers ::get_cat_ID
*/
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
/**
* @group taxonomy
* @group category.php
* @group category
*
* @covers ::get_cat_name
*/
@@ -2,7 +2,7 @@
/**
* @group taxonomy
* @group category.php
* @group category
*
* @covers ::get_categories
*/
@@ -1,7 +1,7 @@
<?php
/**
* @group taxonomy
* @group category.php
* @group category
*
* @covers ::get_category_by_path
*/
@@ -1,7 +1,7 @@
<?php
/**
* @group taxonomy
* @group category.php
* @group category
*
* @covers ::get_category_by_slug
*/
@@ -2,6 +2,7 @@
/**
* @group taxonomy
* @group category
*
* @covers ::get_category_link
*/
@@ -2,6 +2,7 @@
/**
* @group taxonomy
* @group category
*
* @covers ::get_category_parents
*/
@@ -2,6 +2,7 @@
/**
* @group taxonomy
* @group category
*
* @covers ::get_the_category_by_ID
*/
@@ -1,7 +1,7 @@
<?php
/**
* @group taxonomy
* @group category.php
* @group category
*
* @covers ::_make_cat_compat
*/
@@ -1,6 +1,7 @@
<?php
/**
* @group taxonomy
* @group category
* @group walker
*
* @covers Walker_Category::start_el
@@ -1,7 +1,7 @@
<?php
/**
* @group taxonomy
* @group category.php
* @group category
*
* @covers ::wp_dropdown_categories
*/
@@ -2,6 +2,7 @@
/**
* @group taxonomy
* @group category
*
* @covers ::wp_list_categories
*/
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
/**
* @group comment
* @group comment
*
* @covers ::comment_form
*/
+2 -1
View File
@@ -1,7 +1,8 @@
<?php
/**
* @group comment
* @group comment
*
* @covers ::comments_open
*/
class Tests_Comment_CommentsOpen extends WP_UnitTestCase {
@@ -1,10 +1,10 @@
<?php
/**
* @group comment
*
* Testing items that are only testable by grabbing the markup of `comments_template()` from the output buffer.
*
* @group comment
*
* @covers ::comments_template
*/
class Tests_Comment_CommentsTemplate extends WP_UnitTestCase {
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
/**
* @group comment
* @group comment
* @covers ::pings_open
*/
class Tests_Comment_PingsOpen extends WP_UnitTestCase {
@@ -1,7 +1,7 @@
<?php
/**
* @group comment
* @group comment
*
* @covers ::wp_update_comment_count_now
*/
@@ -9,6 +9,7 @@
* @subpackage UnitTests
* @since 4.5.0
*
* @group customize
* @group ajax
*/
class Test_WP_Customize_Selective_Refresh_Ajax extends WP_UnitTestCase {
@@ -3,6 +3,7 @@
/**
* @group date
* @group datetime
*
* @covers ::current_datetime
*/
class Tests_Date_CurrentDatetime extends WP_UnitTestCase {
+1
View File
@@ -3,6 +3,7 @@
/**
* @group date
* @group datetime
*
* @covers ::current_time
*/
class Tests_Date_CurrentTime extends WP_UnitTestCase {
+1
View File
@@ -3,6 +3,7 @@
/**
* @group date
* @group datetime
*
* @covers ::date_i18n
*/
class Tests_Date_DateI18n extends WP_UnitTestCase {
@@ -4,6 +4,7 @@
* @group date
* @group datetime
* @group comment
*
* @covers ::get_comment_date
*/
class Tests_Date_GetCommentDate extends WP_UnitTestCase {
@@ -4,6 +4,7 @@
* @group date
* @group datetime
* @group feed
*
* @covers ::get_feed_build_date
*/
class Tests_Date_GetFeedBuildDate extends WP_UnitTestCase {
@@ -4,6 +4,7 @@
* @group date
* @group datetime
* @group post
*
* @covers ::get_permalink
*/
class Tests_Date_GetPermalink extends WP_UnitTestCase {
+1
View File
@@ -4,6 +4,7 @@
* @group date
* @group datetime
* @group post
*
* @covers ::get_post_time
* @covers ::get_post_modified_time
*/
+1
View File
@@ -4,6 +4,7 @@
* @group date
* @group datetime
* @group post
*
* @covers ::get_the_date
*/
class Tests_Date_GetTheDate extends WP_UnitTestCase {
@@ -4,6 +4,7 @@
* @group date
* @group datetime
* @group post
*
* @covers ::get_the_modified_date
*/
class Tests_Date_GetTheModifiedDate extends WP_UnitTestCase {
@@ -1,9 +1,11 @@
<?php
/**
* @group functions.php
* @group i18n
* @group date
* @group datetime
* @group i18n
* @group functions
*
* @covers ::wp_maybe_decline_date
*/
class Tests_Date_MaybeDeclineDate extends WP_UnitTestCase {
+2
View File
@@ -3,6 +3,8 @@
/**
* @group date
* @group datetime
* @group functions
*
* @covers ::mysql2date
*/
class Tests_Date_mysql2date extends WP_UnitTestCase {
+3 -1
View File
@@ -5,8 +5,10 @@
*
* See query/dateQuery.php for tests that require WP_Query.
*
* @group datequery
* @group date
* @group datetime
* @group datequery
*
* @covers WP_Date_Query
*/
class Tests_Date_Query extends WP_UnitTestCase {
+1
View File
@@ -4,6 +4,7 @@
* @group date
* @group datetime
* @group post
*
* @covers ::the_date
* @covers ::the_weekday_date
*/
+1
View File
@@ -3,6 +3,7 @@
/**
* @group date
* @group datetime
*
* @covers ::wp_date
*/
class Tests_Date_wpDate extends WP_UnitTestCase {
+1
View File
@@ -3,6 +3,7 @@
/**
* @group date
* @group datetime
*
* @covers ::wp_timezone_string
* @covers ::wp_timezone
*/
+1
View File
@@ -4,6 +4,7 @@
* @group date
* @group datetime
* @group xmlrpc
*
* @covers IXR_Date
*/
class Tests_Date_XMLRPC extends WP_XMLRPC_UnitTestCase {
+2 -1
View File
@@ -3,8 +3,9 @@
/**
* Test dbDelta()
*
* @group upgrade
* @group wpdb
* @group dbdelta
* @group upgrade
*
* @covers ::dbDelta
*/
@@ -7,6 +7,8 @@
/**
* Tests for the WP_Classic_To_Block_Menu_Converter_Test class.
*
* @group editor
*/
class WP_Classic_To_Block_Menu_Converter_Test extends WP_UnitTestCase {
@@ -7,6 +7,8 @@
/**
* Tests for the WP_Navigation_Fallback class.
*
* @group editor
*/
class WP_Navigation_Fallback_Test extends WP_UnitTestCase {
+2 -1
View File
@@ -3,7 +3,8 @@
/**
* Tests copy_dir().
*
* @group file.php
* @group file
* @group filesystem
*
* @covers ::copy_dir
*/
@@ -3,8 +3,8 @@
require_once __DIR__ . '/base.php';
/**
* @group file
* @group filesystem
* @group wp-filesystem
*/
class WP_Filesystem_Find_Folder_Test extends WP_Filesystem_UnitTestCase {
@@ -90,7 +90,7 @@ class WP_Filesystem_Find_Folder_Test extends WP_Filesystem_UnitTestCase {
/example.com/www/index.php
/example.com/www/wp-includes/
/example.com/www/wp-content/plugins/
# sub.example.com
/example.com/sub/index.php
/example.com/sub/wp-includes/
+2 -1
View File
@@ -3,7 +3,8 @@
/**
* Tests move_dir().
*
* @group file.php
* @group file
* @group filesystem
*
* @covers ::move_dir
*/
@@ -3,7 +3,8 @@
/**
* Tests _unzip_file_pclzip().
*
* @group file.php
* @group file
* @group filesystem
*
* @covers ::_unzip_file_pclzip
*/
@@ -3,7 +3,8 @@
/**
* Tests _unzip_file_ziparchive().
*
* @group file.php
* @group file
* @group filesystem
*
* @covers ::_unzip_file_ziparchive
*/
@@ -3,7 +3,8 @@
/**
* Tests wp_opcache_invalidate_directory().
*
* @group file.php
* @group file
* @group filesystem
*
* @covers ::wp_opcache_invalidate_directory
*/
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
/**
* @group functions.php
* @group functions
*/
class Tests_Functions extends WP_UnitTestCase {
public function test_wp_parse_args_object() {
@@ -2,7 +2,8 @@
/**
* @group formatting
* @group functions.php
* @group functions
*
* @covers ::add_magic_quotes
*/
class Tests_Functions_AddMagicQuotes extends WP_UnitTestCase {
@@ -2,7 +2,8 @@
/**
* @group formatting
* @group functions.php
* @group functions
*
* @covers ::wp_allowed_protocols
*/
class Tests_Functions_AllowedProtocols extends WP_UnitTestCase {
@@ -6,8 +6,9 @@
*
* @since 4.9.6
*
* @group functions.php
* @group functions
* @group privacy
*
* @covers ::wp_privacy_anonymize_data
*/
class Tests_Functions_Anonymization extends WP_UnitTestCase {
@@ -5,7 +5,8 @@
*
* @since 4.8.0
*
* @group functions.php
* @group functions
*
* @covers ::_canonical_charset
*/
class Tests_Functions_CanonicalCharset extends WP_UnitTestCase {
@@ -3,7 +3,9 @@
/**
* Tests specific to the directory size caching.
*
* @group functions.php
* @group functions
*
* @covers ::clean_dirsize_cache
*/
class Tests_Functions_CleanDirsizeCache extends WP_UnitTestCase {
@@ -12,8 +14,6 @@ class Tests_Functions_CleanDirsizeCache extends WP_UnitTestCase {
*
* @ticket 52241
*
* @covers ::clean_dirsize_cache
*
* @dataProvider data_clean_dirsize_cache_with_invalid_inputs
*
* @param mixed $path Path input to use in the test.
@@ -57,8 +57,6 @@ class Tests_Functions_CleanDirsizeCache extends WP_UnitTestCase {
*
* @ticket 52241
*
* @covers ::clean_dirsize_cache
*
* @dataProvider data_clean_dirsize_cache_with_non_path_string
*
* @param string $path Path input to use in the test.
@@ -5,7 +5,8 @@
* @ticket 8497
* @ticket 38101
*
* @group functions.php
* @group functions
*
* @covers ::_cleanup_header_comment
*/
class Tests_Functions_CleanupHeaderComment extends WP_UnitTestCase {
+2 -1
View File
@@ -7,8 +7,9 @@
*
* @since 5.3.0
*
* @group functions.php
* @group functions
* @group post
*
* @covers ::do_enclose
*/
class Tests_Functions_DoEnclose extends WP_UnitTestCase {
@@ -4,6 +4,7 @@
*
* @package WordPress
*
* @group functions
* @group cache
*
* @covers ::_get_non_cached_ids
@@ -5,7 +5,8 @@
*
* @since 5.3.0
*
* @group functions.php
* @group functions
*
* @covers ::get_status_header_desc
*/
class Tests_Functions_GetStatusHeaderDesc extends WP_UnitTestCase {
@@ -1,7 +1,8 @@
<?php
/**
* @group functions.php
* @group functions
*
* @covers ::get_weekstartend
*/
class Tests_Functions_GetWeekstartend extends WP_UnitTestCase {
+2 -1
View File
@@ -4,7 +4,8 @@
*
* @since 5.2.0
*
* @group functions.php
* @group functions
*
* @covers ::is_new_day
*/
class Tests_Functions_IsNewDate extends WP_UnitTestCase {
@@ -3,7 +3,8 @@
/**
* Tests the is_php_version_compatible() function.
*
* @group functions.php
* @group functions
*
* @covers ::is_php_version_compatible
*/
class Tests_Functions_IsPhpVersionCompatible extends WP_UnitTestCase {
@@ -5,7 +5,8 @@
*
* @ticket 53299
*
* @group functions.php
* @group function
*
* @covers ::is_serialized
*/
class Tests_Functions_IsSerialized extends WP_UnitTestCase {
@@ -5,7 +5,8 @@
*
* @ticket 42870
*
* @group functions.php
* @group functions
*
* @covers ::is_serialized_string
*/
class Tests_Functions_IsSerializedString extends WP_UnitTestCase {
@@ -3,7 +3,8 @@
/**
* Tests the is_wp_version_compatible() function.
*
* @group functions.php
* @group functions
*
* @covers ::is_wp_version_compatible
*/
class Tests_Functions_IsWpVersionCompatible extends WP_UnitTestCase {
+2 -1
View File
@@ -3,7 +3,8 @@
/**
* Test list_files().
*
* @group functions.php
* @group functions
*
* @covers ::list_files
*/
class Tests_Functions_ListFiles extends WP_UnitTestCase {
@@ -3,7 +3,8 @@
/**
* Tests for `maybe_serialize()` and `maybe_unserialize()`.
*
* @group functions.php
* @group functions
*
* @covers ::maybe_serialize
* @covers ::maybe_unserialize
*/
@@ -3,8 +3,9 @@
/**
* Tests for number_format_i18n()
*
* @group functions.php
* @group functions
* @group i18n
*
* @covers ::number_format_i18n
*/
class Tests_Functions_NumberFormatI18n extends WP_UnitTestCase {
@@ -3,8 +3,9 @@
/**
* Tests for plugin_basename()
*
* @group functions.php
* @group function
* @group plugins
*
* @covers ::plugin_basename
*/
class Tests_Functions_PluginBasename extends WP_UnitTestCase {
+2 -1
View File
@@ -3,7 +3,8 @@
/**
* Test wp_get_referer().
*
* @group functions.php
* @group functions
*
* @covers ::wp_get_referer
* @covers ::wp_get_raw_referer
*/
@@ -1,7 +1,8 @@
<?php
/**
* @group functions.php
* @group functions
*
* @covers ::remove_query_arg
*/
class Tests_Functions_RemoveQueryArg extends WP_UnitTestCase {
+2 -1
View File
@@ -7,7 +7,8 @@
* @ticket 36635
* @ticket 40875
*
* @group functions.php
* @group functions
*
* @covers ::size_format
*/
class Tests_Functions_SizeFormat extends WP_UnitTestCase {
@@ -4,7 +4,7 @@
*
* @since 5.1.0
*
* @group functions.php
* @group functions
*/
class Tests_Functions_UnderscoreReturn extends WP_UnitTestCase {
+2 -1
View File
@@ -1,8 +1,9 @@
<?php
/**
* @group functions.php
* @group functions
* @group query
*
* @covers ::wp
*/
class Tests_Functions_WP extends WP_UnitTestCase {
@@ -3,7 +3,7 @@
/**
* Tests for `wp_admin_notice()`.
*
* @group functions.php
* @group functions
*
* @covers ::wp_admin_notice
*/
+2 -1
View File
@@ -5,7 +5,8 @@
*
* @since 5.6.0
*
* @group functions.php
* @group functions
*
* @covers ::_wp_array_get
*/
class Tests_Functions_wpArrayGet extends WP_UnitTestCase {
+2 -1
View File
@@ -5,7 +5,8 @@
*
* @since 5.8.0
*
* @group functions.php
* @group functions
*
* @covers ::_wp_array_set
*/
class Tests_Functions_wpArraySet extends WP_UnitTestCase {
@@ -5,7 +5,8 @@
*
* @since 5.3.0
*
* @group functions.php
* @group functions
*
* @covers ::wp_array_slice_assoc
*/
class Tests_Functions_wpArraySliceAssoc extends WP_UnitTestCase {
@@ -3,7 +3,8 @@
/**
* Tests for the behavior of `wp_auth_check()`
*
* @group functions.php
* @group functions
*
* @covers ::is_user_logged_in
* @covers ::wp_auth_check
*/
@@ -1,7 +1,8 @@
<?php
/**
* @group functions.php
* @group functions
*
* @covers ::_wp_check_alternate_file_names
*/
class Tests_Functions_WpCheckAlternateFileNames extends WP_UnitTestCase {
@@ -3,7 +3,7 @@
/**
* Tests for wp_check_filetype().
*
* @group functions.php
* @group functions
* @group upload
*
* @covers ::wp_check_filetype
+2 -1
View File
@@ -3,7 +3,8 @@
/**
* Tests for the wp_filesize() function.
*
* @group functions.php
* @group functions
*
* @covers ::wp_filesize
*/
class Tests_Functions_wpFilesize extends WP_UnitTestCase {
@@ -3,7 +3,7 @@
/**
* Test wp_filter_object_list().
*
* @group functions.php
* @group functions
* @covers ::wp_filter_object_list
*/
class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
@@ -3,7 +3,8 @@
/**
* Test wp_fuzzy_number_match().
*
* @group functions.php
* @group functions
*
* @covers ::wp_fuzzy_number_match
*/
class Tests_Functions_wpFuzzyNumberMatch extends WP_UnitTestCase {
@@ -3,7 +3,7 @@
/**
* Tests for `wp_get_admin_notice()`.
*
* @group functions.php
* @group functions
*
* @covers ::wp_get_admin_notice
*/
@@ -1,7 +1,8 @@
<?php
/**
* @group functions.php
* @group functions
*
* @covers ::wp_get_archives
*/
class Tests_Functions_wpGetArchives extends WP_UnitTestCase {
@@ -3,7 +3,8 @@
/**
* Test wp_get_mime_types().
*
* @group functions.php
* @group functions
*
* @covers ::wp_get_mime_types
*/
class Tests_Functions_wpGetMimeTypes extends WP_UnitTestCase {
+2 -1
View File
@@ -3,7 +3,8 @@
/**
* Test wp_guess_url().
*
* @group functions.php
* @group functions
*
* @covers ::wp_guess_url
*/
class Tests_Functions_wpGuessUrl extends WP_UnitTestCase {
@@ -1,7 +1,8 @@
<?php
/**
* @group functions.php
* @group functions
*
* @covers ::wp_is_numeric_array
*/
class Tests_Functions_wpIsNumericArray extends WP_UnitTestCase {
@@ -3,7 +3,8 @@
/**
* Test wp_list_filter().
*
* @group functions.php
* @group functions
*
* @covers ::wp_list_filter
*/
class Tests_Functions_wpListFilter extends WP_UnitTestCase {
@@ -3,7 +3,8 @@
/**
* Test wp_list_pluck().
*
* @group functions.php
* @group functions
*
* @covers ::wp_list_pluck
*/
class Tests_Functions_wpListPluck extends WP_UnitTestCase {
+2 -1
View File
@@ -3,7 +3,8 @@
/**
* Test wp_list_sort().
*
* @group functions.php
* @group functions
*
* @covers ::wp_list_sort
*/
class Tests_Functions_wpListSort extends WP_UnitTestCase {
+1 -1
View File
@@ -3,7 +3,7 @@
/**
* Test WP_List_Util class.
*
* @group functions.php
* @group functions
*/
class Tests_Functions_wpListUtil extends WP_UnitTestCase {
+2 -1
View File
@@ -5,7 +5,8 @@
*
* @since 5.9.0
*
* @group functions.php
* @group functions
*
* @covers ::wp_nonce_ays
*/
class Tests_Functions_wpNonceAys extends WP_UnitTestCase {
@@ -5,7 +5,8 @@
*
* @since 6.1.0
*
* @group functions.php
* @group functions
*
* @covers ::wp_nonce_field
*/
class Tests_Functions_wpNonceField extends WP_UnitTestCase {

Some files were not shown because too many files have changed in this diff Show More