- Timestamp:
- 11/30/2017 11:09:33 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/getCommentsPagesCount.php
r42228 r42343 2 2 /** 3 3 * Validate the logic of get_comments_pages_count 4 * 4 5 * @group comment 5 6 */ … … 39 40 function test_empty() { 40 41 //setup post and comments 41 $post_id = self::factory()->post->create( array( 'post_title' => 'comment--post', 'post_type' => 'post' ) ); 42 $post_id = self::factory()->post->create( 43 array( 44 'post_title' => 'comment--post', 45 'post_type' => 'post', 46 ) 47 ); 42 48 $this->go_to( '/?p=' . $post_id ); 43 49 … … 59 65 * Validate get_comments_pages_count for treaded comments 60 66 */ 61 function test_threaded_comments( 67 function test_threaded_comments() { 62 68 //setup post and comments 63 $post = self::factory()->post->create_and_get( array( 'post_title' => 'comment--post', 'post_type' => 'post' ) ); 69 $post = self::factory()->post->create_and_get( 70 array( 71 'post_title' => 'comment--post', 72 'post_type' => 'post', 73 ) 74 ); 64 75 $comments = self::factory()->comment->create_post_comments( $post->ID, 15 ); 65 76 self::factory()->comment->create_post_comments( $post->ID, 6, array( 'comment_parent' => $comments[0] ) ); … … 77 88 78 89 //setup post and comments 79 $post = self::factory()->post->create_and_get( array( 'post_title' => 'comment--post', 'post_type' => 'post' ) ); 90 $post = self::factory()->post->create_and_get( 91 array( 92 'post_title' => 'comment--post', 93 'post_type' => 'post', 94 ) 95 ); 80 96 $comments = self::factory()->comment->create_post_comments( $post->ID, 15 ); 81 self::factory()->comment->create_post_comments( $post->ID, 6, array( 'comment_parent' => $comments[0] ) );97 self::factory()->comment->create_post_comments( $post->ID, 6, array( 'comment_parent' => $comments[0] ) ); 82 98 $comments = get_comments( array( 'post_id' => $post->ID ) ); 83 99 … … 105 121 update_option( 'posts_per_rss', 100 ); 106 122 107 $post = self::factory()->post->create_and_get( array( 'post_title' => 'comment-post', 'post_type' => 'post' ) ); 123 $post = self::factory()->post->create_and_get( 124 array( 125 'post_title' => 'comment-post', 126 'post_type' => 'post', 127 ) 128 ); 108 129 $comments = self::factory()->comment->create_post_comments( $post->ID, 25 ); 109 130 110 $wp_query = new WP_Query( array( 'p' => $post->ID, 'comments_per_page' => 10, 'feed' =>'comments-' ) ); 131 $wp_query = new WP_Query( 132 array( 133 'p' => $post->ID, 134 'comments_per_page' => 10, 135 'feed' => 'comments-', 136 ) 137 ); 111 138 112 139 update_option( 'comments_per_page', 25 ); … … 115 142 $this->assertEquals( 2, get_comment_pages_count( null, 20 ) ); 116 143 117 $wp_query = new WP_Query( array( 'p' => $post->ID,'comments_per_page' => null, 'feed' =>'comments-' ) ); 144 $wp_query = new WP_Query( 145 array( 146 'p' => $post->ID, 147 'comments_per_page' => null, 148 'feed' => 'comments-', 149 ) 150 ); 118 151 119 152 $this->assertEquals( 1, get_comment_pages_count() );
Note: See TracChangeset
for help on using the changeset viewer.