Make WordPress Core


Ignore:
Timestamp:
08/08/2022 11:12:30 PM (4 years ago)
Author:
azaozz
Message:

Build/Test Tools: Add @covers tags to the comments tests.

Props pbearne, jrf, hellofromTonya, patopaiar, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev.
See #39265.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment-submission.php

    r53732 r53863  
    4040        }
    4141
     42        /**
     43         * @covers ::wp_handle_comment_submission
     44         */
    4245        public function test_submitting_comment_to_invalid_post_returns_error() {
    4346                $error = 'comment_id_not_found';
    … …  
    5659        }
    5760
     61        /**
     62         * @covers ::wp_handle_comment_submission
     63         */
    5864        public function test_submitting_comment_to_post_with_closed_comments_returns_error() {
    5965
    … …  
    7985        }
    8086
     87        /**
     88         * @covers ::wp_handle_comment_submission
     89         */
    8190        public function test_submitting_comment_to_trashed_post_returns_error() {
    8291
    … …  
    100109        }
    101110
     111        /**
     112         * @covers ::wp_handle_comment_submission
     113         */
    102114        public function test_submitting_comment_to_draft_post_returns_error() {
    103115                $error = 'comment_on_draft';
    … …  
    125137        /**
    126138         * @ticket 39650
     139         *
     140         * @covers ::wp_handle_comment_submission
    127141         */
    128142        public function test_submitting_comment_to_draft_post_returns_error_message_for_user_with_correct_caps() {
    … …  
    151165        }
    152166
     167        /**
     168         * @covers ::wp_handle_comment_submission
     169         */
    153170        public function test_submitting_comment_to_scheduled_post_returns_error() {
    154171
    … …  
    177194        }
    178195
     196        /**
     197         * @covers ::wp_handle_comment_submission
     198         */
    179199        public function test_submitting_comment_to_password_required_post_returns_error() {
    180200
    … …  
    200220        }
    201221
     222        /**
     223         * @covers ::wp_handle_comment_submission
     224         */
    202225        public function test_submitting_comment_to_password_protected_post_succeeds() {
    203226                if ( PHP_VERSION_ID >= 80100 ) {
    … …  
    237260        }
    238261
     262        /**
     263         * @covers ::wp_handle_comment_submission
     264         */
    239265        public function test_submitting_valid_comment_as_logged_in_user_succeeds() {
    240266
    … …  
    264290        }
    265291
     292        /**
     293         * @covers ::wp_handle_comment_submission
     294         */
    266295        public function test_submitting_valid_comment_anonymously_succeeds() {
    267296
    … …  
    290319         *
    291320         * @group slashes
     321         *
     322         * @covers ::wp_handle_comment_submission
    292323         */
    293324        public function test_submitting_comment_handles_slashes_correctly_handles_slashes() {
    … …  
    319350        }
    320351
     352        /**
     353         * @covers ::wp_handle_comment_submission
     354         */
    321355        public function test_submitting_comment_anonymously_to_private_post_returns_error() {
    322356
    … …  
    340374        }
    341375
     376        /**
     377         * @covers ::wp_handle_comment_submission
     378         */
    342379        public function test_submitting_comment_as_logged_in_user_to_inaccessible_private_post_returns_error() {
    343380
    … …  
    370407        }
    371408
     409        /**
     410         * @covers ::wp_handle_comment_submission
     411         */
    372412        public function test_submitting_comment_to_private_post_with_closed_comments_returns_correct_error() {
    373413
    … …  
    401441        }
    402442
     443        /**
     444         * @covers ::wp_handle_comment_submission
     445         */
    403446        public function test_submitting_comment_to_own_private_post_succeeds() {
    404447
    … …  
    424467        }
    425468
     469        /**
     470         * @covers ::wp_handle_comment_submission
     471         */
    426472        public function test_submitting_comment_to_accessible_private_post_succeeds() {
    427473
    … …  
    447493        }
    448494
     495        /**
     496         * @covers ::wp_handle_comment_submission
     497         */
    449498        public function test_anonymous_user_cannot_comment_unfiltered_html() {
    450499                if ( PHP_VERSION_ID >= 80100 ) {
    … …  
    472521        }
    473522
     523        /**
     524         * @covers ::wp_handle_comment_submission
     525         */
    474526        public function test_unprivileged_user_cannot_comment_unfiltered_html() {
    475527
    … …  
    490542        }
    491543
     544        /**
     545         * @covers ::wp_handle_comment_submission
     546         */
    492547        public function test_unprivileged_user_cannot_comment_unfiltered_html_even_with_valid_nonce() {
    493548
    … …  
    514569        }
    515570
     571        /**
     572         * @covers ::wp_handle_comment_submission
     573         */
    516574        public function test_privileged_user_can_comment_unfiltered_html_with_valid_nonce() {
    517575
    … …  
    546604        }
    547605
     606        /**
     607         * @covers ::wp_handle_comment_submission
     608         */
    548609        public function test_privileged_user_cannot_comment_unfiltered_html_without_valid_nonce() {
    549610
    … …  
    570631        }
    571632
     633        /**
     634         * @covers ::wp_handle_comment_submission
     635         */
    572636        public function test_submitting_comment_as_anonymous_user_when_registration_required_returns_error() {
    573637
    … …  
    589653        }
    590654
     655        /**
     656         * @covers ::wp_handle_comment_submission
     657         */
    591658        public function test_submitting_comment_with_no_name_when_name_email_required_returns_error() {
    592659
    … …  
    610677        }
    611678
     679        /**
     680         * @covers ::wp_handle_comment_submission
     681         */
    612682        public function test_submitting_comment_with_no_email_when_name_email_required_returns_error() {
    613683
    … …  
    631701        }
    632702
     703        /**
     704         * @covers ::wp_handle_comment_submission
     705         */
    633706        public function test_submitting_comment_with_invalid_email_when_name_email_required_returns_error() {
    634707
    … …  
    653726        }
    654727
     728        /**
     729         * @covers ::wp_handle_comment_submission
     730         */
    655731        public function test_submitting_comment_with_no_comment_content_returns_error() {
    656732
    … …  
    672748        /**
    673749         * @ticket 10377
     750         *
     751         * @covers ::wp_handle_comment_submission
    674752         */
    675753        public function test_submitting_comment_with_content_too_long_returns_error() {
    … …  
    690768        /**
    691769         * @ticket 10377
     770         *
     771         * @covers ::wp_handle_comment_submission
    692772         */
    693773        public function test_submitting_comment_with_author_too_long_returns_error() {
    … …  
    708788        /**
    709789         * @ticket 10377
     790         *
     791         * @covers ::wp_handle_comment_submission
    710792         */
    711793        public function test_submitting_comment_with_email_too_long_returns_error() {
    … …  
    726808        /**
    727809         * @ticket 10377
     810         *
     811         * @covers ::wp_handle_comment_submission
    728812         */
    729813        public function test_submitting_comment_with_url_too_long_returns_error() {
    … …  
    745829        /**
    746830         * @ticket 49236
     831         *
     832         * @covers ::wp_handle_comment_submission
    747833         */
    748834        public function test_submitting_comment_with_empty_type_results_in_correct_type() {
    … …  
    774860        /**
    775861         * @ticket 49236
     862         *
     863         * @covers ::wp_insert_comment
    776864         */
    777865        public function test_inserting_comment_with_empty_type_results_in_correct_type() {
    … …  
    794882        /**
    795883         * @ticket 34997
     884         *
     885         * @covers ::wp_handle_comment_submission
    796886         */
    797887        public function test_comment_submission_sends_all_expected_parameters_to_preprocess_comment_filter() {
    … …  
    838928        /**
    839929         * @ticket 36901
     930         *
     931         * @covers ::wp_handle_comment_submission
    840932         */
    841933        public function test_submitting_duplicate_comments() {
    … …  
    864956        /**
    865957         * @ticket 36901
     958         *
     959         * @covers ::wp_handle_comment_submission
    866960         */
    867961        public function test_comments_flood() {
    … …  
    893987        /**
    894988         * @ticket 36901
     989         *
     990         * @covers ::wp_handle_comment_submission
    895991         */
    896992        public function test_comments_flood_user_is_admin() {
Note: See TracChangeset for help on using the changeset viewer.