Make WordPress Core

Changeset 54701


Ignore:
Timestamp:
10/27/2022 03:01:31 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Move wp_handle_comment_submission() tests to the comment directory.

This aims to bring some consistency with other comment function tests.

Includes moving the @covers tags from individual test methods to the class DocBlock.

Follow-up to [34799], [34801], [53863].

See #56793.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/wpHandleCommentSubmission.php

    r54700 r54701  
    33/**
    44 * @group comment
     5 *
     6 * @covers ::wp_handle_comment_submission
    57 */
    6 class Tests_Comment_Submission extends WP_UnitTestCase {
     8class Tests_Comment_wpHandleCommentSubmission extends WP_UnitTestCase {
    79
    810    protected static $post;
     
    4042    }
    4143
    42     /**
    43      * @covers ::wp_handle_comment_submission
    44      */
    4544    public function test_submitting_comment_to_invalid_post_returns_error() {
    4645        $error = 'comment_id_not_found';
     
    5958    }
    6059
    61     /**
    62      * @covers ::wp_handle_comment_submission
    63      */
    6460    public function test_submitting_comment_to_post_with_closed_comments_returns_error() {
    6561
     
    8581    }
    8682
    87     /**
    88      * @covers ::wp_handle_comment_submission
    89      */
    9083    public function test_submitting_comment_to_trashed_post_returns_error() {
    9184
     
    109102    }
    110103
    111     /**
    112      * @covers ::wp_handle_comment_submission
    113      */
    114104    public function test_submitting_comment_to_draft_post_returns_error() {
    115105        $error = 'comment_on_draft';
     
    137127    /**
    138128     * @ticket 39650
    139      *
    140      * @covers ::wp_handle_comment_submission
    141129     */
    142130    public function test_submitting_comment_to_draft_post_returns_error_message_for_user_with_correct_caps() {
     
    165153    }
    166154
    167     /**
    168      * @covers ::wp_handle_comment_submission
    169      */
    170155    public function test_submitting_comment_to_scheduled_post_returns_error() {
    171156
     
    194179    }
    195180
    196     /**
    197      * @covers ::wp_handle_comment_submission
    198      */
    199181    public function test_submitting_comment_to_password_required_post_returns_error() {
    200182
     
    220202    }
    221203
    222     /**
    223      * @covers ::wp_handle_comment_submission
    224      */
    225204    public function test_submitting_comment_to_password_protected_post_succeeds() {
    226205        $password = 'password';
     
    250229    }
    251230
    252     /**
    253      * @covers ::wp_handle_comment_submission
    254      */
    255231    public function test_submitting_valid_comment_as_logged_in_user_succeeds() {
    256232
     
    280256    }
    281257
    282     /**
    283      * @covers ::wp_handle_comment_submission
    284      */
    285258    public function test_submitting_valid_comment_anonymously_succeeds() {
    286259
     
    309282     *
    310283     * @group slashes
    311      *
    312      * @covers ::wp_handle_comment_submission
    313284     */
    314285    public function test_submitting_comment_handles_slashes_correctly() {
     
    330301    }
    331302
    332     /**
    333      * @covers ::wp_handle_comment_submission
    334      */
    335303    public function test_submitting_comment_anonymously_to_private_post_returns_error() {
    336304
     
    354322    }
    355323
    356     /**
    357      * @covers ::wp_handle_comment_submission
    358      */
    359324    public function test_submitting_comment_as_logged_in_user_to_inaccessible_private_post_returns_error() {
    360325
     
    387352    }
    388353
    389     /**
    390      * @covers ::wp_handle_comment_submission
    391      */
    392354    public function test_submitting_comment_to_private_post_with_closed_comments_returns_correct_error() {
    393355
     
    421383    }
    422384
    423     /**
    424      * @covers ::wp_handle_comment_submission
    425      */
    426385    public function test_submitting_comment_to_own_private_post_succeeds() {
    427386
     
    447406    }
    448407
    449     /**
    450      * @covers ::wp_handle_comment_submission
    451      */
    452408    public function test_submitting_comment_to_accessible_private_post_succeeds() {
    453409
     
    473429    }
    474430
    475     /**
    476      * @covers ::wp_handle_comment_submission
    477      */
    478431    public function test_anonymous_user_cannot_comment_unfiltered_html() {
    479432        $data    = array(
     
    491444    }
    492445
    493     /**
    494      * @covers ::wp_handle_comment_submission
    495      */
    496446    public function test_unprivileged_user_cannot_comment_unfiltered_html() {
    497447
     
    512462    }
    513463
    514     /**
    515      * @covers ::wp_handle_comment_submission
    516      */
    517464    public function test_unprivileged_user_cannot_comment_unfiltered_html_even_with_valid_nonce() {
    518465
     
    539486    }
    540487
    541     /**
    542      * @covers ::wp_handle_comment_submission
    543      */
    544488    public function test_privileged_user_can_comment_unfiltered_html_with_valid_nonce() {
    545489
     
    574518    }
    575519
    576     /**
    577      * @covers ::wp_handle_comment_submission
    578      */
    579520    public function test_privileged_user_cannot_comment_unfiltered_html_without_valid_nonce() {
    580521
     
    601542    }
    602543
    603     /**
    604      * @covers ::wp_handle_comment_submission
    605      */
    606544    public function test_submitting_comment_as_anonymous_user_when_registration_required_returns_error() {
    607545
     
    623561    }
    624562
    625     /**
    626      * @covers ::wp_handle_comment_submission
    627      */
    628563    public function test_submitting_comment_with_no_name_when_name_email_required_returns_error() {
    629564
     
    647582    }
    648583
    649     /**
    650      * @covers ::wp_handle_comment_submission
    651      */
    652584    public function test_submitting_comment_with_no_email_when_name_email_required_returns_error() {
    653585
     
    671603    }
    672604
    673     /**
    674      * @covers ::wp_handle_comment_submission
    675      */
    676605    public function test_submitting_comment_with_invalid_email_when_name_email_required_returns_error() {
    677606
     
    696625    }
    697626
    698     /**
    699      * @covers ::wp_handle_comment_submission
    700      */
    701627    public function test_submitting_comment_with_no_comment_content_returns_error() {
    702628
     
    718644    /**
    719645     * @ticket 10377
    720      *
    721      * @covers ::wp_handle_comment_submission
    722646     */
    723647    public function test_submitting_comment_with_content_too_long_returns_error() {
     
    738662    /**
    739663     * @ticket 10377
    740      *
    741      * @covers ::wp_handle_comment_submission
    742664     */
    743665    public function test_submitting_comment_with_author_too_long_returns_error() {
     
    758680    /**
    759681     * @ticket 10377
    760      *
    761      * @covers ::wp_handle_comment_submission
    762682     */
    763683    public function test_submitting_comment_with_email_too_long_returns_error() {
     
    778698    /**
    779699     * @ticket 10377
    780      *
    781      * @covers ::wp_handle_comment_submission
    782700     */
    783701    public function test_submitting_comment_with_url_too_long_returns_error() {
     
    799717    /**
    800718     * @ticket 49236
    801      *
    802      * @covers ::wp_handle_comment_submission
    803719     */
    804720    public function test_submitting_comment_with_empty_type_results_in_correct_type() {
     
    842758    /**
    843759     * @ticket 34997
    844      *
    845      * @covers ::wp_handle_comment_submission
    846760     */
    847761    public function test_comment_submission_sends_all_expected_parameters_to_preprocess_comment_filter() {
     
    880794    /**
    881795     * @ticket 56712
    882      *
    883      * @covers ::wp_handle_comment_submission
    884796     */
    885797    public function test_submitting_comment_without_optional_parameters_sets_them_to_empty_strings() {
     
    913825    /**
    914826     * @ticket 36901
    915      *
    916      * @covers ::wp_handle_comment_submission
    917827     */
    918828    public function test_submitting_duplicate_comments() {
     
    931841    /**
    932842     * @ticket 36901
    933      *
    934      * @covers ::wp_handle_comment_submission
    935843     */
    936844    public function test_comments_flood() {
     
    952860    /**
    953861     * @ticket 36901
    954      *
    955      * @covers ::wp_handle_comment_submission
    956862     */
    957863    public function test_comments_flood_user_is_admin() {
Note: See TracChangeset for help on using the changeset viewer.