Changeset 54701
- Timestamp:
- 10/27/2022 03:01:31 PM (2 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/wpHandleCommentSubmission.php
r54700 r54701 3 3 /** 4 4 * @group comment 5 * 6 * @covers ::wp_handle_comment_submission 5 7 */ 6 class Tests_Comment_ Submission extends WP_UnitTestCase {8 class Tests_Comment_wpHandleCommentSubmission extends WP_UnitTestCase { 7 9 8 10 protected static $post; … … 40 42 } 41 43 42 /**43 * @covers ::wp_handle_comment_submission44 */45 44 public function test_submitting_comment_to_invalid_post_returns_error() { 46 45 $error = 'comment_id_not_found'; … … 59 58 } 60 59 61 /**62 * @covers ::wp_handle_comment_submission63 */64 60 public function test_submitting_comment_to_post_with_closed_comments_returns_error() { 65 61 … … 85 81 } 86 82 87 /**88 * @covers ::wp_handle_comment_submission89 */90 83 public function test_submitting_comment_to_trashed_post_returns_error() { 91 84 … … 109 102 } 110 103 111 /**112 * @covers ::wp_handle_comment_submission113 */114 104 public function test_submitting_comment_to_draft_post_returns_error() { 115 105 $error = 'comment_on_draft'; … … 137 127 /** 138 128 * @ticket 39650 139 *140 * @covers ::wp_handle_comment_submission141 129 */ 142 130 public function test_submitting_comment_to_draft_post_returns_error_message_for_user_with_correct_caps() { … … 165 153 } 166 154 167 /**168 * @covers ::wp_handle_comment_submission169 */170 155 public function test_submitting_comment_to_scheduled_post_returns_error() { 171 156 … … 194 179 } 195 180 196 /**197 * @covers ::wp_handle_comment_submission198 */199 181 public function test_submitting_comment_to_password_required_post_returns_error() { 200 182 … … 220 202 } 221 203 222 /**223 * @covers ::wp_handle_comment_submission224 */225 204 public function test_submitting_comment_to_password_protected_post_succeeds() { 226 205 $password = 'password'; … … 250 229 } 251 230 252 /**253 * @covers ::wp_handle_comment_submission254 */255 231 public function test_submitting_valid_comment_as_logged_in_user_succeeds() { 256 232 … … 280 256 } 281 257 282 /**283 * @covers ::wp_handle_comment_submission284 */285 258 public function test_submitting_valid_comment_anonymously_succeeds() { 286 259 … … 309 282 * 310 283 * @group slashes 311 *312 * @covers ::wp_handle_comment_submission313 284 */ 314 285 public function test_submitting_comment_handles_slashes_correctly() { … … 330 301 } 331 302 332 /**333 * @covers ::wp_handle_comment_submission334 */335 303 public function test_submitting_comment_anonymously_to_private_post_returns_error() { 336 304 … … 354 322 } 355 323 356 /**357 * @covers ::wp_handle_comment_submission358 */359 324 public function test_submitting_comment_as_logged_in_user_to_inaccessible_private_post_returns_error() { 360 325 … … 387 352 } 388 353 389 /**390 * @covers ::wp_handle_comment_submission391 */392 354 public function test_submitting_comment_to_private_post_with_closed_comments_returns_correct_error() { 393 355 … … 421 383 } 422 384 423 /**424 * @covers ::wp_handle_comment_submission425 */426 385 public function test_submitting_comment_to_own_private_post_succeeds() { 427 386 … … 447 406 } 448 407 449 /**450 * @covers ::wp_handle_comment_submission451 */452 408 public function test_submitting_comment_to_accessible_private_post_succeeds() { 453 409 … … 473 429 } 474 430 475 /**476 * @covers ::wp_handle_comment_submission477 */478 431 public function test_anonymous_user_cannot_comment_unfiltered_html() { 479 432 $data = array( … … 491 444 } 492 445 493 /**494 * @covers ::wp_handle_comment_submission495 */496 446 public function test_unprivileged_user_cannot_comment_unfiltered_html() { 497 447 … … 512 462 } 513 463 514 /**515 * @covers ::wp_handle_comment_submission516 */517 464 public function test_unprivileged_user_cannot_comment_unfiltered_html_even_with_valid_nonce() { 518 465 … … 539 486 } 540 487 541 /**542 * @covers ::wp_handle_comment_submission543 */544 488 public function test_privileged_user_can_comment_unfiltered_html_with_valid_nonce() { 545 489 … … 574 518 } 575 519 576 /**577 * @covers ::wp_handle_comment_submission578 */579 520 public function test_privileged_user_cannot_comment_unfiltered_html_without_valid_nonce() { 580 521 … … 601 542 } 602 543 603 /**604 * @covers ::wp_handle_comment_submission605 */606 544 public function test_submitting_comment_as_anonymous_user_when_registration_required_returns_error() { 607 545 … … 623 561 } 624 562 625 /**626 * @covers ::wp_handle_comment_submission627 */628 563 public function test_submitting_comment_with_no_name_when_name_email_required_returns_error() { 629 564 … … 647 582 } 648 583 649 /**650 * @covers ::wp_handle_comment_submission651 */652 584 public function test_submitting_comment_with_no_email_when_name_email_required_returns_error() { 653 585 … … 671 603 } 672 604 673 /**674 * @covers ::wp_handle_comment_submission675 */676 605 public function test_submitting_comment_with_invalid_email_when_name_email_required_returns_error() { 677 606 … … 696 625 } 697 626 698 /**699 * @covers ::wp_handle_comment_submission700 */701 627 public function test_submitting_comment_with_no_comment_content_returns_error() { 702 628 … … 718 644 /** 719 645 * @ticket 10377 720 *721 * @covers ::wp_handle_comment_submission722 646 */ 723 647 public function test_submitting_comment_with_content_too_long_returns_error() { … … 738 662 /** 739 663 * @ticket 10377 740 *741 * @covers ::wp_handle_comment_submission742 664 */ 743 665 public function test_submitting_comment_with_author_too_long_returns_error() { … … 758 680 /** 759 681 * @ticket 10377 760 *761 * @covers ::wp_handle_comment_submission762 682 */ 763 683 public function test_submitting_comment_with_email_too_long_returns_error() { … … 778 698 /** 779 699 * @ticket 10377 780 *781 * @covers ::wp_handle_comment_submission782 700 */ 783 701 public function test_submitting_comment_with_url_too_long_returns_error() { … … 799 717 /** 800 718 * @ticket 49236 801 *802 * @covers ::wp_handle_comment_submission803 719 */ 804 720 public function test_submitting_comment_with_empty_type_results_in_correct_type() { … … 842 758 /** 843 759 * @ticket 34997 844 *845 * @covers ::wp_handle_comment_submission846 760 */ 847 761 public function test_comment_submission_sends_all_expected_parameters_to_preprocess_comment_filter() { … … 880 794 /** 881 795 * @ticket 56712 882 *883 * @covers ::wp_handle_comment_submission884 796 */ 885 797 public function test_submitting_comment_without_optional_parameters_sets_them_to_empty_strings() { … … 913 825 /** 914 826 * @ticket 36901 915 *916 * @covers ::wp_handle_comment_submission917 827 */ 918 828 public function test_submitting_duplicate_comments() { … … 931 841 /** 932 842 * @ticket 36901 933 *934 * @covers ::wp_handle_comment_submission935 843 */ 936 844 public function test_comments_flood() { … … 952 860 /** 953 861 * @ticket 36901 954 *955 * @covers ::wp_handle_comment_submission956 862 */ 957 863 public function test_comments_flood_user_is_admin() {
Note: See TracChangeset
for help on using the changeset viewer.