From 54eca75d04e63e6ff42de92375ac31e5e2c02cd4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 30 Oct 2022 01:05:06 +0000 Subject: [PATCH] Tests: Rename classes in `phpunit/tests/ajax/` per the naming conventions. This updates the test classes to match the names of the functions being tested. Includes moving the `@covers` tags from individual test methods to the class DocBlocks. Reference: [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization Writing PHP Tests: Naming and Organization]. Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265], [53489], [53561], [54704]. See #56793. git-svn-id: https://develop.svn.wordpress.org/trunk@54722 602fd350-edb4-49c9-b593-d223f7449a82 --- .../ajax/{AddMeta.php => wpAjaxAddMeta.php} | 7 +++-- .../ajax/{AddTag.php => wpAjaxAddTag.php} | 8 ++---- ...{TagSearch.php => wpAjaxAjaxTagSearch.php} | 9 +++--- tests/phpunit/tests/ajax/wpAjaxCropImage.php | 1 + ...eteComment.php => wpAjaxDeleteComment.php} | 28 +++++-------------- ...eletePlugin.php => wpAjaxDeletePlugin.php} | 3 +- .../{DimComment.php => wpAjaxDimComment.php} | 9 +++--- ...{EditComment.php => wpAjaxEditComment.php} | 9 +++--- ...{GetComments.php => wpAjaxGetComments.php} | 9 +++--- .../{Autosave.php => wpAjaxHeartbeat.php} | 17 +++++------ .../{MediaEdit.php => wpAjaxImageEditor.php} | 13 +++++---- .../{QuickEdit.php => wpAjaxInlineSave.php} | 5 ++-- ...toComment.php => wpAjaxReplytoComment.php} | 9 +++--- .../ajax/{Response.php => wpAjaxResponse.php} | 9 +++--- ...s.php => wpAjaxSendAttachmentToEditor.php} | 8 +++--- ...pdatePlugin.php => wpAjaxUpdatePlugin.php} | 2 +- ...ManageThemes.php => wpAjaxUpdateTheme.php} | 4 +-- ...ession.php => wpAjaxWpCompressionTest.php} | 25 +++++------------ ...p => wpAjaxWpPrivacyErasePersonalData.php} | 2 +- ... => wpAjaxWpPrivacyExportPersonalData.php} | 2 +- ...mizeManager.php => wpCustomizeManager.php} | 9 +++--- ...omizeMenus.php => wpCustomizeNavMenus.php} | 9 +++--- 22 files changed, 90 insertions(+), 107 deletions(-) rename tests/phpunit/tests/ajax/{AddMeta.php => wpAjaxAddMeta.php} (93%) rename tests/phpunit/tests/ajax/{AddTag.php => wpAjaxAddTag.php} (96%) rename tests/phpunit/tests/ajax/{TagSearch.php => wpAjaxAjaxTagSearch.php} (97%) rename tests/phpunit/tests/ajax/{DeleteComment.php => wpAjaxDeleteComment.php} (95%) rename tests/phpunit/tests/ajax/{DeletePlugin.php => wpAjaxDeletePlugin.php} (97%) rename tests/phpunit/tests/ajax/{DimComment.php => wpAjaxDimComment.php} (98%) rename tests/phpunit/tests/ajax/{EditComment.php => wpAjaxEditComment.php} (98%) rename tests/phpunit/tests/ajax/{GetComments.php => wpAjaxGetComments.php} (96%) rename tests/phpunit/tests/ajax/{Autosave.php => wpAjaxHeartbeat.php} (94%) rename tests/phpunit/tests/ajax/{MediaEdit.php => wpAjaxImageEditor.php} (94%) rename tests/phpunit/tests/ajax/{QuickEdit.php => wpAjaxInlineSave.php} (95%) rename tests/phpunit/tests/ajax/{ReplytoComment.php => wpAjaxReplytoComment.php} (98%) rename tests/phpunit/tests/ajax/{Response.php => wpAjaxResponse.php} (95%) rename tests/phpunit/tests/ajax/{Attachments.php => wpAjaxSendAttachmentToEditor.php} (94%) rename tests/phpunit/tests/ajax/{UpdatePlugin.php => wpAjaxUpdatePlugin.php} (98%) rename tests/phpunit/tests/ajax/{ManageThemes.php => wpAjaxUpdateTheme.php} (97%) rename tests/phpunit/tests/ajax/{Compression.php => wpAjaxWpCompressionTest.php} (91%) rename tests/phpunit/tests/ajax/{PrivacyErasePersonalData.php => wpAjaxWpPrivacyErasePersonalData.php} (99%) rename tests/phpunit/tests/ajax/{PrivacyExportPersonalData.php => wpAjaxWpPrivacyExportPersonalData.php} (99%) rename tests/phpunit/tests/ajax/{CustomizeManager.php => wpCustomizeManager.php} (99%) rename tests/phpunit/tests/ajax/{CustomizeMenus.php => wpCustomizeNavMenus.php} (99%) diff --git a/tests/phpunit/tests/ajax/AddMeta.php b/tests/phpunit/tests/ajax/wpAjaxAddMeta.php similarity index 93% rename from tests/phpunit/tests/ajax/AddMeta.php rename to tests/phpunit/tests/ajax/wpAjaxAddMeta.php index e34adc9c1f..dbaee104ba 100644 --- a/tests/phpunit/tests/ajax/AddMeta.php +++ b/tests/phpunit/tests/ajax/wpAjaxAddMeta.php @@ -9,12 +9,14 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; * Testing Add Meta AJAX functionality. * * @group ajax + * + * @covers ::wp_ajax_add_meta */ -class Tests_Ajax_AddMeta extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxAddMeta extends WP_Ajax_UnitTestCase { + /** * @ticket 43559 * - * @covers ::wp_ajax_add_meta * @covers ::add_post_meta */ public function test_wp_ajax_add_meta_allows_empty_values_on_adding() { @@ -43,7 +45,6 @@ class Tests_Ajax_AddMeta extends WP_Ajax_UnitTestCase { /** * @ticket 43559 * - * @covers ::wp_ajax_add_meta * @covers ::update_metadata_by_mid */ public function test_wp_ajax_add_meta_allows_empty_values_on_updating() { diff --git a/tests/phpunit/tests/ajax/AddTag.php b/tests/phpunit/tests/ajax/wpAjaxAddTag.php similarity index 96% rename from tests/phpunit/tests/ajax/AddTag.php rename to tests/phpunit/tests/ajax/wpAjaxAddTag.php index cf10110d91..6060b1db64 100755 --- a/tests/phpunit/tests/ajax/AddTag.php +++ b/tests/phpunit/tests/ajax/wpAjaxAddTag.php @@ -9,15 +9,16 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; * Class for testing ajax add tag functionality. * * @group ajax + * + * @covers ::wp_ajax_add_tag */ -class Tests_Ajax_AddTag extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxAddTag extends WP_Ajax_UnitTestCase { /** * @dataProvider data_add_tag * * @ticket 42937 * - * @covers ::wp_ajax_add_tag * @covers ::wp_insert_term * * @param array $post_data Data to populate $_POST. @@ -93,8 +94,6 @@ class Tests_Ajax_AddTag extends WP_Ajax_UnitTestCase { /** * @ticket 42937 - * - * @covers ::wp_ajax_add_tag */ public function test_adding_category_without_capability_should_error() { $this->_setRole( 'subscriber' ); @@ -114,7 +113,6 @@ class Tests_Ajax_AddTag extends WP_Ajax_UnitTestCase { /** * @ticket 42937 * - * @covers ::wp_ajax_add_tag * @covers ::wp_insert_term */ public function test_adding_existing_category_should_error() { diff --git a/tests/phpunit/tests/ajax/TagSearch.php b/tests/phpunit/tests/ajax/wpAjaxAjaxTagSearch.php similarity index 97% rename from tests/phpunit/tests/ajax/TagSearch.php rename to tests/phpunit/tests/ajax/wpAjaxAjaxTagSearch.php index 3374033092..fa41463c62 100644 --- a/tests/phpunit/tests/ajax/TagSearch.php +++ b/tests/phpunit/tests/ajax/wpAjaxAjaxTagSearch.php @@ -8,14 +8,15 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** * Testing Ajax tag search functionality. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.4.0 - * @group ajax + * @since 3.4.0 + * + * @group ajax * * @covers ::wp_ajax_ajax_tag_search */ -class Tests_Ajax_TagSearch extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxAjaxTagSearch extends WP_Ajax_UnitTestCase { /** * List of terms to insert on setup diff --git a/tests/phpunit/tests/ajax/wpAjaxCropImage.php b/tests/phpunit/tests/ajax/wpAjaxCropImage.php index 008cfa7d1b..3a23f3a425 100644 --- a/tests/phpunit/tests/ajax/wpAjaxCropImage.php +++ b/tests/phpunit/tests/ajax/wpAjaxCropImage.php @@ -11,6 +11,7 @@ require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; * Class for testing ajax crop image functionality. * * @group ajax + * * @covers ::wp_ajax_crop_image */ class Tests_Ajax_WpAjaxCropImage extends WP_Ajax_UnitTestCase { diff --git a/tests/phpunit/tests/ajax/DeleteComment.php b/tests/phpunit/tests/ajax/wpAjaxDeleteComment.php similarity index 95% rename from tests/phpunit/tests/ajax/DeleteComment.php rename to tests/phpunit/tests/ajax/wpAjaxDeleteComment.php index 84dd82fc8e..c6547f9b7c 100644 --- a/tests/phpunit/tests/ajax/DeleteComment.php +++ b/tests/phpunit/tests/ajax/wpAjaxDeleteComment.php @@ -8,12 +8,15 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** * Testing Ajax comment functionality. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.4.0 - * @group ajax + * @since 3.4.0 + * + * @group ajax + * + * @covers ::wp_ajax_delete_comment */ -class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxDeleteComment extends WP_Ajax_UnitTestCase { /** * List of comments. @@ -57,7 +60,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to pass. * - * @covers ::wp_ajax_delete_comment * @covers ::_wp_ajax_delete_comment_response * * @param WP_Comment $comment Comment object. @@ -119,8 +121,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to fail. * - * @covers ::wp_ajax_delete_comment - * * @param WP_Comment $comment Comment object. * @param string $action Action: 'trash', 'untrash', etc. */ @@ -153,8 +153,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to fail. * - * @covers ::wp_ajax_delete_comment - * * @param WP_Comment $comment Comment object. * @param string $action Action: 'trash', 'untrash', etc. */ @@ -186,8 +184,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to fail. * - * @covers ::wp_ajax_delete_comment - * * @param WP_Comment $comment Comment object. * @param string $action Action: 'trash', 'untrash', etc. */ @@ -225,8 +221,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to fail. * - * @covers ::wp_ajax_delete_comment - * * @param WP_Comment $comment Comment object. * @param string $action Action: 'trash', 'untrash', etc. */ @@ -275,7 +269,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { /** * Deletes a comment as an administrator (expects success). * - * @covers ::wp_ajax_delete_comment * @covers ::_wp_ajax_delete_comment_response */ public function test_ajax_comment_trash_actions_as_administrator() { @@ -293,8 +286,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { /** * Deletes a comment as a subscriber (expects permission denied). - * - * @covers ::wp_ajax_delete_comment */ public function test_ajax_comment_trash_actions_as_subscriber() { // Test trash/untrash. @@ -312,7 +303,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { /** * Deletes a comment with no ID. * - * @covers ::wp_ajax_delete_comment * @covers ::_wp_ajax_delete_comment_response */ public function test_ajax_trash_comment_no_id() { @@ -330,8 +320,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { /** * Deletes a comment with a bad nonce. - * - * @covers ::wp_ajax_delete_comment */ public function test_ajax_trash_comment_bad_nonce() { // Test trash/untrash. @@ -348,8 +336,6 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { /** * Tests trashing an already trashed comment, etc. - * - * @covers ::wp_ajax_delete_comment */ public function test_ajax_trash_double_action() { // Test trash/untrash. diff --git a/tests/phpunit/tests/ajax/DeletePlugin.php b/tests/phpunit/tests/ajax/wpAjaxDeletePlugin.php similarity index 97% rename from tests/phpunit/tests/ajax/DeletePlugin.php rename to tests/phpunit/tests/ajax/wpAjaxDeletePlugin.php index 57a66a0dbf..1fc3d9422d 100644 --- a/tests/phpunit/tests/ajax/DeletePlugin.php +++ b/tests/phpunit/tests/ajax/wpAjaxDeletePlugin.php @@ -11,7 +11,7 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; * * @covers ::wp_ajax_delete_plugin */ -class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxDeletePlugin extends WP_Ajax_UnitTestCase { public function test_missing_nonce() { $this->expectException( 'WPAjaxDieStopException' ); @@ -130,7 +130,6 @@ class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase { /** * @group ms-excluded * - * @covers ::wp_ajax_delete_plugin * @covers ::delete_plugins */ public function test_delete_plugin() { diff --git a/tests/phpunit/tests/ajax/DimComment.php b/tests/phpunit/tests/ajax/wpAjaxDimComment.php similarity index 98% rename from tests/phpunit/tests/ajax/DimComment.php rename to tests/phpunit/tests/ajax/wpAjaxDimComment.php index 6881279e07..2fde579605 100644 --- a/tests/phpunit/tests/ajax/DimComment.php +++ b/tests/phpunit/tests/ajax/wpAjaxDimComment.php @@ -8,14 +8,15 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** * Testing Ajax comment functionality * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.4.0 - * @group ajax + * @since 3.4.0 + * + * @group ajax * * @covers ::wp_ajax_dim_comment */ -class Tests_Ajax_DimComment extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxDimComment extends WP_Ajax_UnitTestCase { /** * List of comments. diff --git a/tests/phpunit/tests/ajax/EditComment.php b/tests/phpunit/tests/ajax/wpAjaxEditComment.php similarity index 98% rename from tests/phpunit/tests/ajax/EditComment.php rename to tests/phpunit/tests/ajax/wpAjaxEditComment.php index fba7bd46a3..fb39bd4dae 100644 --- a/tests/phpunit/tests/ajax/EditComment.php +++ b/tests/phpunit/tests/ajax/wpAjaxEditComment.php @@ -8,14 +8,15 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** * Testing Ajax comment functionality. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.4.0 - * @group ajax + * @since 3.4.0 + * + * @group ajax * * @covers ::wp_ajax_edit_comment */ -class Tests_Ajax_EditComment extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxEditComment extends WP_Ajax_UnitTestCase { /** * A post with at least one comment. diff --git a/tests/phpunit/tests/ajax/GetComments.php b/tests/phpunit/tests/ajax/wpAjaxGetComments.php similarity index 96% rename from tests/phpunit/tests/ajax/GetComments.php rename to tests/phpunit/tests/ajax/wpAjaxGetComments.php index a828aa3df6..4e72d1c8b8 100644 --- a/tests/phpunit/tests/ajax/GetComments.php +++ b/tests/phpunit/tests/ajax/wpAjaxGetComments.php @@ -8,14 +8,15 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** * Testing Ajax comment functionality. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.4.0 - * @group ajax + * @since 3.4.0 + * + * @group ajax * * @covers ::wp_ajax_get_comments */ -class Tests_Ajax_GetComments extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxGetComments extends WP_Ajax_UnitTestCase { /** * A post with at least one comment. diff --git a/tests/phpunit/tests/ajax/Autosave.php b/tests/phpunit/tests/ajax/wpAjaxHeartbeat.php similarity index 94% rename from tests/phpunit/tests/ajax/Autosave.php rename to tests/phpunit/tests/ajax/wpAjaxHeartbeat.php index c0f9371f1a..6759d9f0db 100644 --- a/tests/phpunit/tests/ajax/Autosave.php +++ b/tests/phpunit/tests/ajax/wpAjaxHeartbeat.php @@ -8,12 +8,15 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** * Testing Ajax save draft functionality. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.4.0 - * @group ajax + * @since 3.4.0 + * + * @group ajax + * + * @covers ::wp_ajax_heartbeat */ -class Tests_Ajax_Autosave extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxHeartbeat extends WP_Ajax_UnitTestCase { /** * Post @@ -40,8 +43,6 @@ class Tests_Ajax_Autosave extends WP_Ajax_UnitTestCase { /** * Tests autosaving a post. - * - * @covers ::wp_ajax_heartbeat */ public function test_autosave_post() { // The original post_author. @@ -83,8 +84,6 @@ class Tests_Ajax_Autosave extends WP_Ajax_UnitTestCase { /** * Tests autosaving a locked post. - * - * @covers ::wp_ajax_heartbeat */ public function test_autosave_locked_post() { // Lock the post to another user. @@ -136,8 +135,6 @@ class Tests_Ajax_Autosave extends WP_Ajax_UnitTestCase { /** * Tests with an invalid nonce. - * - * @covers ::wp_ajax_heartbeat */ public function test_with_invalid_nonce() { diff --git a/tests/phpunit/tests/ajax/MediaEdit.php b/tests/phpunit/tests/ajax/wpAjaxImageEditor.php similarity index 94% rename from tests/phpunit/tests/ajax/MediaEdit.php rename to tests/phpunit/tests/ajax/wpAjaxImageEditor.php index 83c478c83b..f09721b74f 100644 --- a/tests/phpunit/tests/ajax/MediaEdit.php +++ b/tests/phpunit/tests/ajax/wpAjaxImageEditor.php @@ -7,14 +7,17 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** * Testing Ajax media editing. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.5.0 - * @group ajax + * @since 3.5.0 * - * @requires function imagejpeg + * @group ajax + * + * @covers ::wp_ajax_image_editor + * + * @requires function imagejpeg */ -class Tests_Ajax_MediaEdit extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxImageEditor extends WP_Ajax_UnitTestCase { /** * Tear down the test fixture. diff --git a/tests/phpunit/tests/ajax/QuickEdit.php b/tests/phpunit/tests/ajax/wpAjaxInlineSave.php similarity index 95% rename from tests/phpunit/tests/ajax/QuickEdit.php rename to tests/phpunit/tests/ajax/wpAjaxInlineSave.php index d94f3d6cb2..ad03e8eb00 100644 --- a/tests/phpunit/tests/ajax/QuickEdit.php +++ b/tests/phpunit/tests/ajax/wpAjaxInlineSave.php @@ -9,13 +9,14 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; * Testing Quick Edit AJAX functionality. * * @group ajax + * + * @covers ::wp_ajax_inline_save */ -class Tests_Ajax_QuickEdit extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxInlineSave extends WP_Ajax_UnitTestCase { /** * @ticket 26948 * - * @covers ::wp_ajax_inline_save * @covers ::edit_post */ public function test_dont_process_terms_if_taxonomy_does_not_allow_show_on_quick_edit() { diff --git a/tests/phpunit/tests/ajax/ReplytoComment.php b/tests/phpunit/tests/ajax/wpAjaxReplytoComment.php similarity index 98% rename from tests/phpunit/tests/ajax/ReplytoComment.php rename to tests/phpunit/tests/ajax/wpAjaxReplytoComment.php index 6a150ca12b..3700418b21 100644 --- a/tests/phpunit/tests/ajax/ReplytoComment.php +++ b/tests/phpunit/tests/ajax/wpAjaxReplytoComment.php @@ -8,14 +8,15 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** * Testing Ajax comment functionality. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.4.0 - * @group ajax + * @since 3.4.0 + * + * @group ajax * * @covers ::wp_ajax_replyto_comment */ -class Tests_Ajax_ReplytoComment extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxReplytoComment extends WP_Ajax_UnitTestCase { /** * A post with at least one comment. diff --git a/tests/phpunit/tests/ajax/Response.php b/tests/phpunit/tests/ajax/wpAjaxResponse.php similarity index 95% rename from tests/phpunit/tests/ajax/Response.php rename to tests/phpunit/tests/ajax/wpAjaxResponse.php index bf3335ad98..8573dae527 100644 --- a/tests/phpunit/tests/ajax/Response.php +++ b/tests/phpunit/tests/ajax/wpAjaxResponse.php @@ -2,14 +2,15 @@ /** * Testing Ajax response class * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.5.0 - * @group ajax + * @since 3.5.0 + * + * @group ajax * * @covers WP_Ajax_Response::send */ -class Tests_Ajax_Response extends WP_UnitTestCase { +class Tests_Ajax_wpAjaxResponse extends WP_UnitTestCase { /** * Saved error reporting level diff --git a/tests/phpunit/tests/ajax/Attachments.php b/tests/phpunit/tests/ajax/wpAjaxSendAttachmentToEditor.php similarity index 94% rename from tests/phpunit/tests/ajax/Attachments.php rename to tests/phpunit/tests/ajax/wpAjaxSendAttachmentToEditor.php index f1a6232c5f..277ce3d299 100644 --- a/tests/phpunit/tests/ajax/Attachments.php +++ b/tests/phpunit/tests/ajax/wpAjaxSendAttachmentToEditor.php @@ -8,12 +8,14 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; * Testing Ajax attachment handling. * * @group ajax + * + * @covers ::wp_ajax_send_attachment_to_editor */ -class Tests_Ajax_Attachments extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxSendAttachmentToEditor extends WP_Ajax_UnitTestCase { + /** * @ticket 36578 * - * @covers ::wp_ajax_send_attachment_to_editor * @covers ::get_image_send_to_editor */ public function test_wp_ajax_send_attachment_to_editor_should_return_an_image() { @@ -58,8 +60,6 @@ class Tests_Ajax_Attachments extends WP_Ajax_UnitTestCase { /** * @ticket 36578 * @group ms-excluded - * - * @covers ::wp_ajax_send_attachment_to_editor */ public function test_wp_ajax_send_attachment_to_editor_should_return_a_link() { // Become an administrator. diff --git a/tests/phpunit/tests/ajax/UpdatePlugin.php b/tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php similarity index 98% rename from tests/phpunit/tests/ajax/UpdatePlugin.php rename to tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php index 07ab868ea3..daae271ef6 100644 --- a/tests/phpunit/tests/ajax/UpdatePlugin.php +++ b/tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php @@ -11,7 +11,7 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; * * @covers ::wp_ajax_update_plugin */ -class Tests_Ajax_Update_Plugin extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxUpdatePlugin extends WP_Ajax_UnitTestCase { public function test_missing_nonce() { $this->expectException( 'WPAjaxDieStopException' ); diff --git a/tests/phpunit/tests/ajax/ManageThemes.php b/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php similarity index 97% rename from tests/phpunit/tests/ajax/ManageThemes.php rename to tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php index f689515fe3..4e3f8a8e6a 100644 --- a/tests/phpunit/tests/ajax/ManageThemes.php +++ b/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php @@ -5,13 +5,13 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** - * Testing Ajax handler for instlaling, updating, and deleting themes. + * Testing Ajax handler for installing, updating, and deleting themes. * * @group ajax * * @covers ::wp_ajax_update_theme */ -class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxUpdateTheme extends WP_Ajax_UnitTestCase { private $orig_theme_dir; private $theme_root; diff --git a/tests/phpunit/tests/ajax/Compression.php b/tests/phpunit/tests/ajax/wpAjaxWpCompressionTest.php similarity index 91% rename from tests/phpunit/tests/ajax/Compression.php rename to tests/phpunit/tests/ajax/wpAjaxWpCompressionTest.php index 4de6c2d154..ebca789033 100644 --- a/tests/phpunit/tests/ajax/Compression.php +++ b/tests/phpunit/tests/ajax/wpAjaxWpCompressionTest.php @@ -8,17 +8,18 @@ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; /** * Testing Ajax compression test functionality. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 3.4.0 - * @group ajax + * @since 3.4.0 + * + * @group ajax + * + * @covers ::wp_ajax_wp_compression_test */ -class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxWpCompressionTest extends WP_Ajax_UnitTestCase { /** * Test as a logged out user - * - * @covers ::wp_ajax_wp_compression_test */ public function test_logged_out() { $this->logout(); @@ -34,8 +35,6 @@ class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase { /** * Fetch the test text - * - * @covers ::wp_ajax_wp_compression_test */ public function test_text() { @@ -60,8 +59,6 @@ class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase { * Fetch the test text (gzdeflate) * * @requires function gzdeflate - * - * @covers ::wp_ajax_wp_compression_test */ public function test_gzdeflate() { @@ -87,8 +84,6 @@ class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase { * Fetch the test text (gzencode) * * @requires function gzencode - * - * @covers ::wp_ajax_wp_compression_test */ public function test_gzencode() { @@ -112,8 +107,6 @@ class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase { /** * Fetch the test text (unknown encoding) - * - * @covers ::wp_ajax_wp_compression_test */ public function test_unknown_encoding() { @@ -132,8 +125,6 @@ class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase { /** * Set the 'can_compress_scripts' site option to true - * - * @covers ::wp_ajax_wp_compression_test */ public function test_set_yes() { @@ -172,8 +163,6 @@ class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase { /** * Set the 'can_compress_scripts' site option to false - * - * @covers ::wp_ajax_wp_compression_test */ public function test_set_no() { diff --git a/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php b/tests/phpunit/tests/ajax/wpAjaxWpPrivacyErasePersonalData.php similarity index 99% rename from tests/phpunit/tests/ajax/PrivacyErasePersonalData.php rename to tests/phpunit/tests/ajax/wpAjaxWpPrivacyErasePersonalData.php index 194840f163..068165b991 100644 --- a/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php +++ b/tests/phpunit/tests/ajax/wpAjaxWpPrivacyErasePersonalData.php @@ -16,7 +16,7 @@ * * @covers ::wp_ajax_wp_privacy_erase_personal_data */ -class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxWpPrivacyErasePersonalData extends WP_Ajax_UnitTestCase { /** * User Request ID. diff --git a/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php b/tests/phpunit/tests/ajax/wpAjaxWpPrivacyExportPersonalData.php similarity index 99% rename from tests/phpunit/tests/ajax/PrivacyExportPersonalData.php rename to tests/phpunit/tests/ajax/wpAjaxWpPrivacyExportPersonalData.php index 4707635a70..f8e588ff5e 100644 --- a/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php +++ b/tests/phpunit/tests/ajax/wpAjaxWpPrivacyExportPersonalData.php @@ -16,7 +16,7 @@ * * @covers ::wp_ajax_wp_privacy_export_personal_data */ -class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpAjaxWpPrivacyExportPersonalData extends WP_Ajax_UnitTestCase { /** * User Request ID. diff --git a/tests/phpunit/tests/ajax/CustomizeManager.php b/tests/phpunit/tests/ajax/wpCustomizeManager.php similarity index 99% rename from tests/phpunit/tests/ajax/CustomizeManager.php rename to tests/phpunit/tests/ajax/wpCustomizeManager.php index 7cf71d1df9..15ee1f0d5c 100644 --- a/tests/phpunit/tests/ajax/CustomizeManager.php +++ b/tests/phpunit/tests/ajax/wpCustomizeManager.php @@ -2,12 +2,13 @@ /** * Testing Ajax customize manager functionality. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 4.3.0 - * @group ajax + * @since 4.3.0 + * + * @group ajax */ -class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpCustomizeManager extends WP_Ajax_UnitTestCase { /** * Instance of WP_Customize_Manager which is reset for each test. diff --git a/tests/phpunit/tests/ajax/CustomizeMenus.php b/tests/phpunit/tests/ajax/wpCustomizeNavMenus.php similarity index 99% rename from tests/phpunit/tests/ajax/CustomizeMenus.php rename to tests/phpunit/tests/ajax/wpCustomizeNavMenus.php index 92a1263919..db34c1c5d0 100644 --- a/tests/phpunit/tests/ajax/CustomizeMenus.php +++ b/tests/phpunit/tests/ajax/wpCustomizeNavMenus.php @@ -2,12 +2,13 @@ /** * Testing Ajax customize menus functionality. * - * @package WordPress + * @package WordPress * @subpackage UnitTests - * @since 4.3.0 - * @group ajax + * @since 4.3.0 + * + * @group ajax */ -class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { +class Tests_Ajax_wpCustomizeNavMenus extends WP_Ajax_UnitTestCase { /** * Instance of WP_Customize_Manager which is reset for each test.