Changeset 35242 for trunk/tests/phpunit/tests/comment/commentsTemplate.php
- Timestamp:
- 10/17/2015 06:02:16 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/commentsTemplate.php
r35225 r35242 13 13 public function test_should_respect_comment_order_asc_when_default_comments_page_is_newest() { 14 14 $now = time(); 15 $p = self:: $factory->post->create();16 $comment_1 = self:: $factory->comment->create( array(17 'comment_post_ID' => $p, 18 'comment_content' => '1', 19 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 20 ) ); 21 $comment_2 = self:: $factory->comment->create( array(15 $p = self::factory()->post->create(); 16 $comment_1 = self::factory()->comment->create( array( 17 'comment_post_ID' => $p, 18 'comment_content' => '1', 19 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 20 ) ); 21 $comment_2 = self::factory()->comment->create( array( 22 22 'comment_post_ID' => $p, 23 23 'comment_content' => '2', … … 43 43 public function test_should_respect_comment_order_desc_when_default_comments_page_is_newest() { 44 44 $now = time(); 45 $p = self:: $factory->post->create();46 $comment_1 = self:: $factory->comment->create( array(47 'comment_post_ID' => $p, 48 'comment_content' => '1', 49 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 50 ) ); 51 $comment_2 = self:: $factory->comment->create( array(45 $p = self::factory()->post->create(); 46 $comment_1 = self::factory()->comment->create( array( 47 'comment_post_ID' => $p, 48 'comment_content' => '1', 49 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 50 ) ); 51 $comment_2 = self::factory()->comment->create( array( 52 52 'comment_post_ID' => $p, 53 53 'comment_content' => '2', … … 73 73 public function test_should_respect_comment_order_asc_when_default_comments_page_is_oldest() { 74 74 $now = time(); 75 $p = self:: $factory->post->create();76 $comment_1 = self:: $factory->comment->create( array(77 'comment_post_ID' => $p, 78 'comment_content' => '1', 79 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 80 ) ); 81 $comment_2 = self:: $factory->comment->create( array(75 $p = self::factory()->post->create(); 76 $comment_1 = self::factory()->comment->create( array( 77 'comment_post_ID' => $p, 78 'comment_content' => '1', 79 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 80 ) ); 81 $comment_2 = self::factory()->comment->create( array( 82 82 'comment_post_ID' => $p, 83 83 'comment_content' => '2', … … 103 103 public function test_should_respect_comment_order_desc_when_default_comments_page_is_oldest() { 104 104 $now = time(); 105 $p = self:: $factory->post->create();106 $comment_1 = self:: $factory->comment->create( array(107 'comment_post_ID' => $p, 108 'comment_content' => '1', 109 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 110 ) ); 111 $comment_2 = self:: $factory->comment->create( array(105 $p = self::factory()->post->create(); 106 $comment_1 = self::factory()->comment->create( array( 107 'comment_post_ID' => $p, 108 'comment_content' => '1', 109 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 110 ) ); 111 $comment_2 = self::factory()->comment->create( array( 112 112 'comment_post_ID' => $p, 113 113 'comment_content' => '2', … … 133 133 public function test_should_respect_comment_order_asc_when_default_comments_page_is_newest_on_subsequent_pages() { 134 134 $now = time(); 135 $p = self:: $factory->post->create();136 $comment_1 = self:: $factory->comment->create( array(137 'comment_post_ID' => $p, 138 'comment_content' => '1', 139 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 140 ) ); 141 $comment_2 = self:: $factory->comment->create( array(142 'comment_post_ID' => $p, 143 'comment_content' => '2', 144 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 145 ) ); 146 $comment_3 = self:: $factory->comment->create( array(147 'comment_post_ID' => $p, 148 'comment_content' => '3', 149 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 150 ) ); 151 $comment_4 = self:: $factory->comment->create( array(135 $p = self::factory()->post->create(); 136 $comment_1 = self::factory()->comment->create( array( 137 'comment_post_ID' => $p, 138 'comment_content' => '1', 139 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 140 ) ); 141 $comment_2 = self::factory()->comment->create( array( 142 'comment_post_ID' => $p, 143 'comment_content' => '2', 144 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 145 ) ); 146 $comment_3 = self::factory()->comment->create( array( 147 'comment_post_ID' => $p, 148 'comment_content' => '3', 149 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 150 ) ); 151 $comment_4 = self::factory()->comment->create( array( 152 152 'comment_post_ID' => $p, 153 153 'comment_content' => '4', 154 154 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ), 155 155 ) ); 156 $comment_5 = self:: $factory->comment->create( array(156 $comment_5 = self::factory()->comment->create( array( 157 157 'comment_post_ID' => $p, 158 158 'comment_content' => '3', 159 159 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 500 ), 160 160 ) ); 161 $comment_6 = self:: $factory->comment->create( array(161 $comment_6 = self::factory()->comment->create( array( 162 162 'comment_post_ID' => $p, 163 163 'comment_content' => '4', … … 188 188 public function test_should_respect_comment_order_desc_when_default_comments_page_is_newest_on_subsequent_pages() { 189 189 $now = time(); 190 $p = self:: $factory->post->create();191 $comment_1 = self:: $factory->comment->create( array(192 'comment_post_ID' => $p, 193 'comment_content' => '1', 194 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 195 ) ); 196 $comment_2 = self:: $factory->comment->create( array(197 'comment_post_ID' => $p, 198 'comment_content' => '2', 199 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 200 ) ); 201 $comment_3 = self:: $factory->comment->create( array(202 'comment_post_ID' => $p, 203 'comment_content' => '3', 204 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 205 ) ); 206 $comment_4 = self:: $factory->comment->create( array(190 $p = self::factory()->post->create(); 191 $comment_1 = self::factory()->comment->create( array( 192 'comment_post_ID' => $p, 193 'comment_content' => '1', 194 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 195 ) ); 196 $comment_2 = self::factory()->comment->create( array( 197 'comment_post_ID' => $p, 198 'comment_content' => '2', 199 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 200 ) ); 201 $comment_3 = self::factory()->comment->create( array( 202 'comment_post_ID' => $p, 203 'comment_content' => '3', 204 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 205 ) ); 206 $comment_4 = self::factory()->comment->create( array( 207 207 'comment_post_ID' => $p, 208 208 'comment_content' => '4', 209 209 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ), 210 210 ) ); 211 $comment_5 = self:: $factory->comment->create( array(211 $comment_5 = self::factory()->comment->create( array( 212 212 'comment_post_ID' => $p, 213 213 'comment_content' => '3', 214 214 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 500 ), 215 215 ) ); 216 $comment_6 = self:: $factory->comment->create( array(216 $comment_6 = self::factory()->comment->create( array( 217 217 'comment_post_ID' => $p, 218 218 'comment_content' => '4', … … 243 243 public function test_should_respect_comment_order_asc_when_default_comments_page_is_oldest_on_subsequent_pages() { 244 244 $now = time(); 245 $p = self:: $factory->post->create();246 $comment_1 = self:: $factory->comment->create( array(247 'comment_post_ID' => $p, 248 'comment_content' => '1', 249 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 250 ) ); 251 $comment_2 = self:: $factory->comment->create( array(252 'comment_post_ID' => $p, 253 'comment_content' => '2', 254 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 255 ) ); 256 $comment_3 = self:: $factory->comment->create( array(257 'comment_post_ID' => $p, 258 'comment_content' => '3', 259 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 260 ) ); 261 $comment_4 = self:: $factory->comment->create( array(245 $p = self::factory()->post->create(); 246 $comment_1 = self::factory()->comment->create( array( 247 'comment_post_ID' => $p, 248 'comment_content' => '1', 249 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 250 ) ); 251 $comment_2 = self::factory()->comment->create( array( 252 'comment_post_ID' => $p, 253 'comment_content' => '2', 254 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 255 ) ); 256 $comment_3 = self::factory()->comment->create( array( 257 'comment_post_ID' => $p, 258 'comment_content' => '3', 259 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 260 ) ); 261 $comment_4 = self::factory()->comment->create( array( 262 262 'comment_post_ID' => $p, 263 263 'comment_content' => '4', … … 288 288 public function test_should_respect_comment_order_desc_when_default_comments_page_is_oldest_on_subsequent_pages() { 289 289 $now = time(); 290 $p = self:: $factory->post->create();291 $comment_1 = self:: $factory->comment->create( array(292 'comment_post_ID' => $p, 293 'comment_content' => '1', 294 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 295 ) ); 296 $comment_2 = self:: $factory->comment->create( array(297 'comment_post_ID' => $p, 298 'comment_content' => '2', 299 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 300 ) ); 301 $comment_3 = self:: $factory->comment->create( array(302 'comment_post_ID' => $p, 303 'comment_content' => '3', 304 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 305 ) ); 306 $comment_4 = self:: $factory->comment->create( array(290 $p = self::factory()->post->create(); 291 $comment_1 = self::factory()->comment->create( array( 292 'comment_post_ID' => $p, 293 'comment_content' => '1', 294 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 295 ) ); 296 $comment_2 = self::factory()->comment->create( array( 297 'comment_post_ID' => $p, 298 'comment_content' => '2', 299 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 300 ) ); 301 $comment_3 = self::factory()->comment->create( array( 302 'comment_post_ID' => $p, 303 'comment_content' => '3', 304 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 305 ) ); 306 $comment_4 = self::factory()->comment->create( array( 307 307 'comment_post_ID' => $p, 308 308 'comment_content' => '4', … … 335 335 public function test_last_page_of_comments_should_be_full_when_default_comment_page_is_newest() { 336 336 $now = time(); 337 $p = self:: $factory->post->create();338 $comment_1 = self:: $factory->comment->create( array(339 'comment_post_ID' => $p, 340 'comment_content' => '1', 341 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 342 ) ); 343 $comment_2 = self:: $factory->comment->create( array(344 'comment_post_ID' => $p, 345 'comment_content' => '2', 346 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 347 ) ); 348 $comment_3 = self:: $factory->comment->create( array(337 $p = self::factory()->post->create(); 338 $comment_1 = self::factory()->comment->create( array( 339 'comment_post_ID' => $p, 340 'comment_content' => '1', 341 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 342 ) ); 343 $comment_2 = self::factory()->comment->create( array( 344 'comment_post_ID' => $p, 345 'comment_content' => '2', 346 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 347 ) ); 348 $comment_3 = self::factory()->comment->create( array( 349 349 'comment_post_ID' => $p, 350 350 'comment_content' => '3', … … 377 377 public function test_first_page_of_comments_should_have_remainder_when_default_comments_page_is_newest() { 378 378 $now = time(); 379 $p = self:: $factory->post->create();380 $comment_1 = self:: $factory->comment->create( array(381 'comment_post_ID' => $p, 382 'comment_content' => '1', 383 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 384 ) ); 385 $comment_2 = self:: $factory->comment->create( array(386 'comment_post_ID' => $p, 387 'comment_content' => '2', 388 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 389 ) ); 390 $comment_3 = self:: $factory->comment->create( array(379 $p = self::factory()->post->create(); 380 $comment_1 = self::factory()->comment->create( array( 381 'comment_post_ID' => $p, 382 'comment_content' => '1', 383 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 384 ) ); 385 $comment_2 = self::factory()->comment->create( array( 386 'comment_post_ID' => $p, 387 'comment_content' => '2', 388 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 389 ) ); 390 $comment_3 = self::factory()->comment->create( array( 391 391 'comment_post_ID' => $p, 392 392 'comment_content' => '3', … … 417 417 public function test_comment_permalinks_should_be_correct_when_using_default_display_callback_with_default_comment_page_oldest() { 418 418 $now = time(); 419 $p = self:: $factory->post->create();420 $comment_1 = self:: $factory->comment->create( array(421 'comment_post_ID' => $p, 422 'comment_content' => '1', 423 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 424 ) ); 425 $comment_2 = self:: $factory->comment->create( array(426 'comment_post_ID' => $p, 427 'comment_content' => '2', 428 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 429 ) ); 430 $comment_3 = self:: $factory->comment->create( array(431 'comment_post_ID' => $p, 432 'comment_content' => '3', 433 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 434 ) ); 435 $comment_4 = self:: $factory->comment->create( array(419 $p = self::factory()->post->create(); 420 $comment_1 = self::factory()->comment->create( array( 421 'comment_post_ID' => $p, 422 'comment_content' => '1', 423 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 424 ) ); 425 $comment_2 = self::factory()->comment->create( array( 426 'comment_post_ID' => $p, 427 'comment_content' => '2', 428 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 429 ) ); 430 $comment_3 = self::factory()->comment->create( array( 431 'comment_post_ID' => $p, 432 'comment_content' => '3', 433 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 434 ) ); 435 $comment_4 = self::factory()->comment->create( array( 436 436 'comment_post_ID' => $p, 437 437 'comment_content' => '4', … … 481 481 public function test_comment_permalinks_should_be_correct_when_using_default_display_callback_with_default_comment_page_newest() { 482 482 $now = time(); 483 $p = self:: $factory->post->create();484 $comment_1 = self:: $factory->comment->create( array(485 'comment_post_ID' => $p, 486 'comment_content' => '1', 487 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 488 ) ); 489 $comment_2 = self:: $factory->comment->create( array(490 'comment_post_ID' => $p, 491 'comment_content' => '2', 492 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 493 ) ); 494 $comment_3 = self:: $factory->comment->create( array(495 'comment_post_ID' => $p, 496 'comment_content' => '3', 497 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 498 ) ); 499 $comment_4 = self:: $factory->comment->create( array(483 $p = self::factory()->post->create(); 484 $comment_1 = self::factory()->comment->create( array( 485 'comment_post_ID' => $p, 486 'comment_content' => '1', 487 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ), 488 ) ); 489 $comment_2 = self::factory()->comment->create( array( 490 'comment_post_ID' => $p, 491 'comment_content' => '2', 492 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ), 493 ) ); 494 $comment_3 = self::factory()->comment->create( array( 495 'comment_post_ID' => $p, 496 'comment_content' => '3', 497 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ), 498 ) ); 499 $comment_4 = self::factory()->comment->create( array( 500 500 'comment_post_ID' => $p, 501 501 'comment_content' => '4', 502 502 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ), 503 503 ) ); 504 $comment_5 = self:: $factory->comment->create( array(504 $comment_5 = self::factory()->comment->create( array( 505 505 'comment_post_ID' => $p, 506 506 'comment_content' => '4', 507 507 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 500 ), 508 508 ) ); 509 $comment_6 = self:: $factory->comment->create( array(509 $comment_6 = self::factory()->comment->create( array( 510 510 'comment_post_ID' => $p, 511 511 'comment_content' => '4',
Note: See TracChangeset
for help on using the changeset viewer.