Changeset 34660
- Timestamp:
- 09/28/2015 03:09:34 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-functions.php
r34561 r34660 878 878 $comment_args = array( 879 879 'type' => $args['type'], 880 'post_ ID' => $comment->comment_post_ID,880 'post_id' => $comment->comment_post_ID, 881 881 'fields' => 'ids', 882 882 'status' => 'approve', -
trunk/tests/phpunit/tests/comment/getPageOfComment.php
r34540 r34660 172 172 $this->assertEquals( 2, get_page_of_comment( $c1, array( 'per_page' => 2 ) ) ); 173 173 } 174 175 /** 176 * @ticket 34057 177 */ 178 public function test_query_should_be_limited_to_comments_on_the_proper_post() { 179 $posts = $this->factory->post->create_many( 2 ); 180 181 $now = time(); 182 $comments_0 = $comments_1 = array(); 183 for ( $i = 0; $i < 5; $i++ ) { 184 $comments_0[] = $this->factory->comment->create( array( 'comment_post_ID' => $posts[0], 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - ( $i * 60 ) ) ) ); 185 $comments_1[] = $this->factory->comment->create( array( 'comment_post_ID' => $posts[1], 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - ( $i * 60 ) ) ) ); 186 } 187 188 $found_0 = get_page_of_comment( $comments_0[0], array( 'per_page' => 2 ) ); 189 $this->assertEquals( 3, $found_0 ); 190 191 $found_1 = get_page_of_comment( $comments_1[1], array( 'per_page' => 2 ) ); 192 $this->assertEquals( 2, $found_1 ); 193 } 174 194 }
Note: See TracChangeset
for help on using the changeset viewer.