Changeset 36226 for trunk/tests/phpunit/tests/comment/commentsTemplate.php
- Timestamp:
- 01/08/2016 10:16:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/commentsTemplate.php
r36040 r36226 690 690 return $commenter; 691 691 } 692 693 /** 694 * @ticket 35378 695 */ 696 public function test_hierarchy_should_be_ignored_when_threading_is_disabled() { 697 $now = time(); 698 $p = self::factory()->post->create(); 699 $comment_1 = self::factory()->comment->create( array( 700 'comment_post_ID' => $p, 701 'comment_content' => '1', 702 'comment_approved' => '1', 703 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 704 ) ); 705 $comment_2 = self::factory()->comment->create( array( 706 'comment_post_ID' => $p, 707 'comment_content' => '2', 708 'comment_approved' => '1', 709 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 710 ) ); 711 $comment_3 = self::factory()->comment->create( array( 712 'comment_post_ID' => $p, 713 'comment_content' => '3', 714 'comment_approved' => '1', 715 'comment_parent' => $comment_1, 716 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 717 ) ); 718 719 update_option( 'comment_order', 'asc' ); 720 update_option( 'thread_comments', 0 ); 721 722 $this->go_to( get_permalink( $p ) ); 723 $found = get_echo( 'comments_template' ); 724 725 // Find the found comments in the markup. 726 preg_match_all( '|id="comment-([0-9]+)|', $found, $matches ); 727 728 $found_cids = array_map( 'intval', $matches[1] ); 729 $this->assertSame( array( $comment_2, $comment_3, $comment_1 ), $found_cids ); 730 } 692 731 }
Note: See TracChangeset
for help on using the changeset viewer.