- Timestamp:
- 01/02/2017 08:06:59 PM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/tests/phpunit/tests/comment/getPageOfComment.php
r38740 r39664 242 242 /** 243 243 * @ticket 31101 244 */ 245 public function test_should_respect_comment_order_newest() { 244 * @ticket 39280 245 */ 246 public function test_should_ignore_comment_order() { 246 247 $now = time(); 247 248 … … 250 251 $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $p, 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 20 ) ) ); 251 252 $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $p, 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 30 ) ) ); 253 $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $p, 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 40 ) ) ); 252 254 253 255 update_option( 'comment_order', 'desc' ); 254 256 update_option( 'page_comments', 1 ); 255 update_option( 'comments_per_page', 2);257 update_option( 'comments_per_page', 1 ); 256 258 257 259 $this->assertEquals( 2, get_page_of_comment( $c3 ) ); 258 260 } 261 262 /** 263 * @ticket 31101 264 * @ticket 39280 265 */ 266 public function test_should_ignore_default_comment_page() { 267 $now = time(); 268 269 $p = self::factory()->post->create(); 270 $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $p, 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now ) ) ); 271 $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $p, 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 20 ) ) ); 272 $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $p, 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 30 ) ) ); 273 $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $p, 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 40 ) ) ); 274 275 update_option( 'default_comment_page', 'newest' ); 276 update_option( 'page_comments', 1 ); 277 update_option( 'comments_per_page', 1 ); 278 279 $this->assertEquals( 2, get_page_of_comment( $c3 ) ); 280 } 259 281 }
Note: See TracChangeset
for help on using the changeset viewer.