Changeset 44659 for trunk/tests/phpunit/tests/comment/commentsTemplate.php
- Timestamp:
- 01/21/2019 01:33:50 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/commentsTemplate.php
r43571 r44659 833 833 834 834 /** 835 * @ticket 43857 836 */ 837 public function test_comments_list_should_include_just_posted_unapproved_comment() { 838 $now = time(); 839 $p = self::factory()->post->create(); 840 $c = self::factory()->comment->create( 841 array( 842 'comment_post_ID' => $p, 843 'comment_content' => '1', 844 'comment_approved' => '0', 845 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now ), 846 'comment_author_email' => 'foo@bar.mail', 847 ) 848 ); 849 $comment = get_comment( $c ); 850 851 $this->go_to( 852 add_query_arg( 853 array( 854 'unapproved' => $comment->comment_ID, 855 'moderation-hash' => wp_hash( $comment->comment_date_gmt ), 856 ), 857 get_comment_link( $comment ) 858 ) 859 ); 860 861 $found = get_echo( 'comments_template' ); 862 863 // Find the found comment in the markup. 864 preg_match( '|id="comment-([0-9]+)|', $found, $matches ); 865 866 $found_cid = (int) $matches[1]; 867 $this->assertSame( $c, $found_cid ); 868 } 869 870 /** 835 871 * @ticket 35378 836 872 */
Note: See TracChangeset
for help on using the changeset viewer.