Changeset 47626 for trunk/tests/phpunit/tests/comment-submission.php
- Timestamp:
- 04/26/2020 01:42:03 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment-submission.php
r47597 r47626 714 714 $this->assertWPError( $comment ); 715 715 $this->assertSame( $error, $comment->get_error_code() ); 716 } 717 718 /** 719 * @ticket 49236 720 */ 721 public function test_submitting_comment_with_empty_type_results_in_correct_type() { 722 $data = array( 723 'comment_post_ID' => self::$post->ID, 724 'comment' => 'Comment', 725 'author' => 'Comment Author', 726 'email' => 'comment@example.org', 727 'comment_type' => '', 728 ); 729 $comment = wp_handle_comment_submission( $data ); 730 731 $this->assertNotWPError( $comment ); 732 $this->assertInstanceOf( 'WP_Comment', $comment ); 733 734 $this->assertSame( 'comment', $comment->comment_type ); 735 } 736 737 /** 738 * @ticket 49236 739 */ 740 public function test_inserting_comment_with_empty_type_results_in_correct_type() { 741 $data = array( 742 'comment_post_ID' => self::$post->ID, 743 'comment' => 'Comment', 744 'author' => 'Comment Author', 745 'email' => 'comment@example.org', 746 'comment_type' => '', 747 ); 748 $comment_id = wp_insert_comment( $data ); 749 $comment = get_comment( $comment_id ); 750 751 $this->assertNotWPError( $comment ); 752 $this->assertInstanceOf( 'WP_Comment', $comment ); 753 754 $this->assertSame( 'comment', $comment->comment_type ); 716 755 } 717 756
Note: See TracChangeset
for help on using the changeset viewer.