Make WordPress Core

Changeset 54722


Ignore:
Timestamp:
10/30/2022 01:05:06 AM (2 years ago)
Author:
SergeyBiryukov
Message:

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: 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.

Location:
trunk/tests/phpunit/tests/ajax
Files:
1 edited
21 moved

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ajax/wpAjaxAddMeta.php

    r54721 r54722  
    1010 *
    1111 * @group ajax
     12 *
     13 * @covers ::wp_ajax_add_meta
    1214 */
    13 class Tests_Ajax_AddMeta extends WP_Ajax_UnitTestCase {
     15class Tests_Ajax_wpAjaxAddMeta extends WP_Ajax_UnitTestCase {
     16
    1417    /**
    1518     * @ticket 43559
    1619     *
    17      * @covers ::wp_ajax_add_meta
    1820     * @covers ::add_post_meta
    1921     */
     
    4446     * @ticket 43559
    4547     *
    46      * @covers ::wp_ajax_add_meta
    4748     * @covers ::update_metadata_by_mid
    4849     */
  • trunk/tests/phpunit/tests/ajax/wpAjaxAddTag.php

    r54721 r54722  
    1010 *
    1111 * @group ajax
     12 *
     13 * @covers ::wp_ajax_add_tag
    1214 */
    13 class Tests_Ajax_AddTag extends WP_Ajax_UnitTestCase {
     15class Tests_Ajax_wpAjaxAddTag extends WP_Ajax_UnitTestCase {
    1416
    1517    /**
     
    1820     * @ticket 42937
    1921     *
    20      * @covers ::wp_ajax_add_tag
    2122     * @covers ::wp_insert_term
    2223     *
     
    9495    /**
    9596     * @ticket 42937
    96      *
    97      * @covers ::wp_ajax_add_tag
    9897     */
    9998    public function test_adding_category_without_capability_should_error() {
     
    115114     * @ticket 42937
    116115     *
    117      * @covers ::wp_ajax_add_tag
    118116     * @covers ::wp_insert_term
    119117     */
  • trunk/tests/phpunit/tests/ajax/wpAjaxAjaxTagSearch.php

    r54721 r54722  
    99 * Testing Ajax tag search functionality.
    1010 *
    11  * @package    WordPress
     11 * @package WordPress
    1212 * @subpackage UnitTests
    13  * @since      3.4.0
    14  * @group      ajax
     13 * @since 3.4.0
     14 *
     15 * @group ajax
    1516 *
    1617 * @covers ::wp_ajax_ajax_tag_search
    1718 */
    18 class Tests_Ajax_TagSearch extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxAjaxTagSearch extends WP_Ajax_UnitTestCase {
    1920
    2021    /**
  • trunk/tests/phpunit/tests/ajax/wpAjaxCropImage.php

    r53441 r54722  
    1212 *
    1313 * @group ajax
     14 *
    1415 * @covers ::wp_ajax_crop_image
    1516 */
  • trunk/tests/phpunit/tests/ajax/wpAjaxDeleteComment.php

    r54721 r54722  
    99 * Testing Ajax comment functionality.
    1010 *
    11  * @package    WordPress
     11 * @package WordPress
    1212 * @subpackage UnitTests
    13  * @since      3.4.0
    14  * @group      ajax
     13 * @since 3.4.0
     14 *
     15 * @group ajax
     16 *
     17 * @covers ::wp_ajax_delete_comment
    1518 */
    16 class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxDeleteComment extends WP_Ajax_UnitTestCase {
    1720
    1821    /**
     
    5861     * Expects test to pass.
    5962     *
    60      * @covers ::wp_ajax_delete_comment
    6163     * @covers ::_wp_ajax_delete_comment_response
    6264     *
     
    120122     * Expects test to fail.
    121123     *
    122      * @covers ::wp_ajax_delete_comment
    123      *
    124124     * @param WP_Comment $comment Comment object.
    125125     * @param string     $action  Action: 'trash', 'untrash', etc.
     
    154154     * Expects test to fail.
    155155     *
    156      * @covers ::wp_ajax_delete_comment
    157      *
    158156     * @param WP_Comment $comment Comment object.
    159157     * @param string     $action  Action: 'trash', 'untrash', etc.
     
    186184     *
    187185     * Expects test to fail.
    188      *
    189      * @covers ::wp_ajax_delete_comment
    190186     *
    191187     * @param WP_Comment $comment Comment object.
     
    226222     * Expects test to fail.
    227223     *
    228      * @covers ::wp_ajax_delete_comment
    229      *
    230224     * @param WP_Comment $comment Comment object.
    231225     * @param string     $action  Action: 'trash', 'untrash', etc.
     
    276270     * Deletes a comment as an administrator (expects success).
    277271     *
    278      * @covers ::wp_ajax_delete_comment
    279272     * @covers ::_wp_ajax_delete_comment_response
    280273     */
     
    294287    /**
    295288     * Deletes a comment as a subscriber (expects permission denied).
    296      *
    297      * @covers ::wp_ajax_delete_comment
    298289     */
    299290    public function test_ajax_comment_trash_actions_as_subscriber() {
     
    313304     * Deletes a comment with no ID.
    314305     *
    315      * @covers ::wp_ajax_delete_comment
    316306     * @covers ::_wp_ajax_delete_comment_response
    317307     */
     
    331321    /**
    332322     * Deletes a comment with a bad nonce.
    333      *
    334      * @covers ::wp_ajax_delete_comment
    335323     */
    336324    public function test_ajax_trash_comment_bad_nonce() {
     
    349337    /**
    350338     * Tests trashing an already trashed comment, etc.
    351      *
    352      * @covers ::wp_ajax_delete_comment
    353339     */
    354340    public function test_ajax_trash_double_action() {
  • trunk/tests/phpunit/tests/ajax/wpAjaxDeletePlugin.php

    r54721 r54722  
    1212 * @covers ::wp_ajax_delete_plugin
    1313 */
    14 class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase {
     14class Tests_Ajax_wpAjaxDeletePlugin extends WP_Ajax_UnitTestCase {
    1515
    1616    public function test_missing_nonce() {
     
    131131     * @group ms-excluded
    132132     *
    133      * @covers ::wp_ajax_delete_plugin
    134133     * @covers ::delete_plugins
    135134     */
  • trunk/tests/phpunit/tests/ajax/wpAjaxDimComment.php

    r54721 r54722  
    99 * Testing Ajax comment functionality
    1010 *
    11  * @package    WordPress
     11 * @package WordPress
    1212 * @subpackage UnitTests
    13  * @since      3.4.0
    14  * @group      ajax
     13 * @since 3.4.0
     14 *
     15 * @group ajax
    1516 *
    1617 * @covers ::wp_ajax_dim_comment
    1718 */
    18 class Tests_Ajax_DimComment extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxDimComment extends WP_Ajax_UnitTestCase {
    1920
    2021    /**
  • trunk/tests/phpunit/tests/ajax/wpAjaxEditComment.php

    r54721 r54722  
    99 * Testing Ajax comment functionality.
    1010 *
    11  * @package    WordPress
     11 * @package WordPress
    1212 * @subpackage UnitTests
    13  * @since      3.4.0
    14  * @group      ajax
     13 * @since 3.4.0
     14 *
     15 * @group ajax
    1516 *
    1617 * @covers ::wp_ajax_edit_comment
    1718 */
    18 class Tests_Ajax_EditComment extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxEditComment extends WP_Ajax_UnitTestCase {
    1920
    2021    /**
  • trunk/tests/phpunit/tests/ajax/wpAjaxGetComments.php

    r54721 r54722  
    99 * Testing Ajax comment functionality.
    1010 *
    11  * @package    WordPress
     11 * @package WordPress
    1212 * @subpackage UnitTests
    13  * @since      3.4.0
    14  * @group      ajax
     13 * @since 3.4.0
     14 *
     15 * @group ajax
    1516 *
    1617 * @covers ::wp_ajax_get_comments
    1718 */
    18 class Tests_Ajax_GetComments extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxGetComments extends WP_Ajax_UnitTestCase {
    1920
    2021    /**
  • trunk/tests/phpunit/tests/ajax/wpAjaxHeartbeat.php

    r54721 r54722  
    99 * Testing Ajax save draft functionality.
    1010 *
    11  * @package    WordPress
     11 * @package WordPress
    1212 * @subpackage UnitTests
    13  * @since      3.4.0
    14  * @group      ajax
     13 * @since 3.4.0
     14 *
     15 * @group ajax
     16 *
     17 * @covers ::wp_ajax_heartbeat
    1518 */
    16 class Tests_Ajax_Autosave extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxHeartbeat extends WP_Ajax_UnitTestCase {
    1720
    1821    /**
     
    4144    /**
    4245     * Tests autosaving a post.
    43      *
    44      * @covers ::wp_ajax_heartbeat
    4546     */
    4647    public function test_autosave_post() {
     
    8485    /**
    8586     * Tests autosaving a locked post.
    86      *
    87      * @covers ::wp_ajax_heartbeat
    8887     */
    8988    public function test_autosave_locked_post() {
     
    137136    /**
    138137     * Tests with an invalid nonce.
    139      *
    140      * @covers ::wp_ajax_heartbeat
    141138     */
    142139    public function test_with_invalid_nonce() {
  • trunk/tests/phpunit/tests/ajax/wpAjaxImageEditor.php

    r54721 r54722  
    88 * Testing Ajax media editing.
    99 *
    10  * @package    WordPress
     10 * @package WordPress
    1111 * @subpackage UnitTests
    12  * @since      3.5.0
    13  * @group      ajax
     12 * @since 3.5.0
    1413 *
    15  * @requires   function imagejpeg
     14 * @group ajax
     15 *
     16 * @covers ::wp_ajax_image_editor
     17 *
     18 * @requires function imagejpeg
    1619 */
    17 class Tests_Ajax_MediaEdit extends WP_Ajax_UnitTestCase {
     20class Tests_Ajax_wpAjaxImageEditor extends WP_Ajax_UnitTestCase {
    1821
    1922    /**
  • trunk/tests/phpunit/tests/ajax/wpAjaxInlineSave.php

    r54721 r54722  
    1010 *
    1111 * @group ajax
     12 *
     13 * @covers ::wp_ajax_inline_save
    1214 */
    13 class Tests_Ajax_QuickEdit extends WP_Ajax_UnitTestCase {
     15class Tests_Ajax_wpAjaxInlineSave extends WP_Ajax_UnitTestCase {
    1416
    1517    /**
    1618     * @ticket 26948
    1719     *
    18      * @covers ::wp_ajax_inline_save
    1920     * @covers ::edit_post
    2021     */
  • trunk/tests/phpunit/tests/ajax/wpAjaxReplytoComment.php

    r54721 r54722  
    99 * Testing Ajax comment functionality.
    1010 *
    11  * @package    WordPress
     11 * @package WordPress
    1212 * @subpackage UnitTests
    13  * @since      3.4.0
    14  * @group      ajax
     13 * @since 3.4.0
     14 *
     15 * @group ajax
    1516 *
    1617 * @covers ::wp_ajax_replyto_comment
    1718 */
    18 class Tests_Ajax_ReplytoComment extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxReplytoComment extends WP_Ajax_UnitTestCase {
    1920
    2021    /**
  • trunk/tests/phpunit/tests/ajax/wpAjaxResponse.php

    r54721 r54722  
    33 * Testing Ajax response class
    44 *
    5  * @package    WordPress
     5 * @package WordPress
    66 * @subpackage UnitTests
    7  * @since      3.5.0
    8  * @group      ajax
     7 * @since 3.5.0
     8 *
     9 * @group ajax
    910 *
    1011 * @covers WP_Ajax_Response::send
    1112 */
    12 class Tests_Ajax_Response extends WP_UnitTestCase {
     13class Tests_Ajax_wpAjaxResponse extends WP_UnitTestCase {
    1314
    1415    /**
  • trunk/tests/phpunit/tests/ajax/wpAjaxSendAttachmentToEditor.php

    r54721 r54722  
    99 *
    1010 * @group ajax
     11 *
     12 * @covers ::wp_ajax_send_attachment_to_editor
    1113 */
    12 class Tests_Ajax_Attachments extends WP_Ajax_UnitTestCase {
     14class Tests_Ajax_wpAjaxSendAttachmentToEditor extends WP_Ajax_UnitTestCase {
     15
    1316    /**
    1417     * @ticket 36578
    1518     *
    16      * @covers ::wp_ajax_send_attachment_to_editor
    1719     * @covers ::get_image_send_to_editor
    1820     */
     
    5961     * @ticket 36578
    6062     * @group ms-excluded
    61      *
    62      * @covers ::wp_ajax_send_attachment_to_editor
    6363     */
    6464    public function test_wp_ajax_send_attachment_to_editor_should_return_a_link() {
  • trunk/tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php

    r54721 r54722  
    1212 * @covers ::wp_ajax_update_plugin
    1313 */
    14 class Tests_Ajax_Update_Plugin extends WP_Ajax_UnitTestCase {
     14class Tests_Ajax_wpAjaxUpdatePlugin extends WP_Ajax_UnitTestCase {
    1515
    1616    public function test_missing_nonce() {
  • trunk/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php

    r54721 r54722  
    66
    77/**
    8  * Testing Ajax handler for instlaling, updating, and deleting themes.
     8 * Testing Ajax handler for installing, updating, and deleting themes.
    99 *
    1010 * @group ajax
     
    1212 * @covers ::wp_ajax_update_theme
    1313 */
    14 class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase {
     14class Tests_Ajax_wpAjaxUpdateTheme extends WP_Ajax_UnitTestCase {
    1515    private $orig_theme_dir;
    1616    private $theme_root;
  • trunk/tests/phpunit/tests/ajax/wpAjaxWpCompressionTest.php

    r54721 r54722  
    99 * Testing Ajax compression test functionality.
    1010 *
    11  * @package    WordPress
     11 * @package WordPress
    1212 * @subpackage UnitTests
    13  * @since      3.4.0
    14  * @group      ajax
     13 * @since 3.4.0
     14 *
     15 * @group ajax
     16 *
     17 * @covers ::wp_ajax_wp_compression_test
    1518 */
    16 class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxWpCompressionTest extends WP_Ajax_UnitTestCase {
    1720
    1821    /**
    1922     * Test as a logged out user
    20      *
    21      * @covers ::wp_ajax_wp_compression_test
    2223     */
    2324    public function test_logged_out() {
     
    3536    /**
    3637     * Fetch the test text
    37      *
    38      * @covers ::wp_ajax_wp_compression_test
    3938     */
    4039    public function test_text() {
     
    6160     *
    6261     * @requires function gzdeflate
    63      *
    64      * @covers ::wp_ajax_wp_compression_test
    6562     */
    6663    public function test_gzdeflate() {
     
    8885     *
    8986     * @requires function gzencode
    90      *
    91      * @covers ::wp_ajax_wp_compression_test
    9287     */
    9388    public function test_gzencode() {
     
    113108    /**
    114109     * Fetch the test text (unknown encoding)
    115      *
    116      * @covers ::wp_ajax_wp_compression_test
    117110     */
    118111    public function test_unknown_encoding() {
     
    133126    /**
    134127     * Set the 'can_compress_scripts' site option to true
    135      *
    136      * @covers ::wp_ajax_wp_compression_test
    137128     */
    138129    public function test_set_yes() {
     
    173164    /**
    174165     * Set the 'can_compress_scripts' site option to false
    175      *
    176      * @covers ::wp_ajax_wp_compression_test
    177166     */
    178167    public function test_set_no() {
  • trunk/tests/phpunit/tests/ajax/wpAjaxWpPrivacyErasePersonalData.php

    r54721 r54722  
    1717 * @covers ::wp_ajax_wp_privacy_erase_personal_data
    1818 */
    19 class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxWpPrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
    2020
    2121    /**
  • trunk/tests/phpunit/tests/ajax/wpAjaxWpPrivacyExportPersonalData.php

    r54721 r54722  
    1717 * @covers ::wp_ajax_wp_privacy_export_personal_data
    1818 */
    19 class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
     19class Tests_Ajax_wpAjaxWpPrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
    2020
    2121    /**
  • trunk/tests/phpunit/tests/ajax/wpCustomizeManager.php

    r54721 r54722  
    33 * Testing Ajax customize manager functionality.
    44 *
    5  * @package    WordPress
     5 * @package WordPress
    66 * @subpackage UnitTests
    7  * @since      4.3.0
    8  * @group      ajax
     7 * @since 4.3.0
     8 *
     9 * @group ajax
    910 */
    10 class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase {
     11class Tests_Ajax_wpCustomizeManager extends WP_Ajax_UnitTestCase {
    1112
    1213    /**
  • trunk/tests/phpunit/tests/ajax/wpCustomizeNavMenus.php

    r54721 r54722  
    33 * Testing Ajax customize menus functionality.
    44 *
    5  * @package    WordPress
     5 * @package WordPress
    66 * @subpackage UnitTests
    7  * @since      4.3.0
    8  * @group      ajax
     7 * @since 4.3.0
     8 *
     9 * @group ajax
    910 */
    10 class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase {
     11class Tests_Ajax_wpCustomizeNavMenus extends WP_Ajax_UnitTestCase {
    1112
    1213    /**
Note: See TracChangeset for help on using the changeset viewer.