Changeset 36039
- Timestamp:
- 12/21/2015 02:57:06 AM (9 years ago)
- Location:
- branches/4.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
-
branches/4.4/src/wp-includes/comment.php
r35745 r36039 2751 2751 $comment_author_email = $user->user_email; 2752 2752 $comment_author_url = $user->user_url; 2753 $user_ id= $user->ID;2753 $user_ID = $user->ID; 2754 2754 if ( current_user_can( 'unfiltered_html' ) ) { 2755 2755 if ( ! isset( $comment_data['_wp_unfiltered_html_comment'] ) … … 2788 2788 'comment_type', 2789 2789 'comment_parent', 2790 'user_ id'2790 'user_ID' 2791 2791 ); 2792 2792 -
branches/4.4/tests/phpunit/tests/comment-submission.php
r35745 r36039 5 5 */ 6 6 class Tests_Comment_Submission extends WP_UnitTestCase { 7 8 protected $preprocess_comment_data = array(); 7 9 8 10 function setUp() { … … 591 593 } 592 594 595 /** 596 * @ticket 34997 597 */ 598 public function test_comment_submission_sends_all_expected_parameters_to_preprocess_comment_filter() { 599 600 $user = self::factory()->user->create_and_get( array( 601 'role' => 'author', 602 ) ); 603 wp_set_current_user( $user->ID ); 604 605 $post = self::factory()->post->create_and_get(); 606 $data = array( 607 'comment_post_ID' => $post->ID, 608 'comment' => 'Comment', 609 ); 610 611 add_filter( 'preprocess_comment', array( $this, 'filter_preprocess_comment' ) ); 612 613 $comment = wp_handle_comment_submission( $data ); 614 615 remove_filter( 'preprocess_comment', array( $this, 'filter_preprocess_comment' ) ); 616 617 $this->assertNotWPError( $comment ); 618 $this->assertEquals( array( 619 'comment_post_ID' => $post->ID, 620 'comment_author' => $user->display_name, 621 'comment_author_email' => $user->user_email, 622 'comment_author_url' => $user->user_url, 623 'comment_content' => $data['comment'], 624 'comment_type' => '', 625 'comment_parent' => '0', 626 'user_ID' => $user->ID, 627 'user_id' => $user->ID, 628 ), $this->preprocess_comment_data ); 629 630 } 631 632 public function filter_preprocess_comment( $commentdata ) { 633 $this->preprocess_comment_data = $commentdata; 634 return $commentdata; 635 } 636 593 637 }
Note: See TracChangeset
for help on using the changeset viewer.