Changeset 36215 for trunk/tests/phpunit/tests/comment.php
- Timestamp:
- 01/07/2016 03:54:05 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/comment.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment.php
r36119 r36215 637 637 $this->assertTrue( $draft_comment_status ); 638 638 } 639 640 /** 641 * @ticket 35276 642 */ 643 public function test_wp_update_comment_author_id_and_agent() { 644 645 $default_data = array( 646 'comment_post_ID' => self::$post_id, 647 'comment_author' => rand_str(), 648 'comment_author_IP' => '192.168.0.1', 649 'comment_agent' => 'WRONG_AGENT', 650 'comment_author_url' => '', 651 'comment_author_email' => '', 652 'comment_type' => '', 653 'comment_content' => rand_str(), 654 ); 655 656 $comment_id = wp_new_comment( $default_data ); 657 658 // Confirm that the IP and Agent are correct on initial save. 659 $save = get_comment( $comment_id ); 660 $this->assertSame( $default_data['comment_author_IP'], $save->comment_author_IP ); 661 $this->assertSame( $default_data['comment_agent'], $save->comment_agent ); 662 663 // Update the comment. 664 wp_update_comment( array( 665 'comment_ID' => $comment_id, 666 'comment_author_IP' => '111.111.1.1', 667 'comment_agent' => 'SHIELD_AGENT', 668 ) ); 669 670 // Retrieve and check the new values. 671 $updated = get_comment( $comment_id ); 672 $this->assertSame( '111.111.1.1', $updated->comment_author_IP ); 673 $this->assertSame( 'SHIELD_AGENT', $updated->comment_agent ); 674 } 639 675 }
Note: See TracChangeset
for help on using the changeset viewer.