Changeset 35162 for trunk/tests/phpunit/tests/query/conditionals.php
- Timestamp:
- 10/14/2015 09:23:03 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/conditionals.php
r34810 r35162 252 252 // 'page/?([0-9]{1,})/?$' => 'index.php?&paged=$matches[1]', 253 253 function test_paged() { 254 $this->factory->post->create_many( 15 ); 254 update_option( 'posts_per_page', 2 ); 255 $this->factory->post->create_many( 5 ); 255 256 for ( $i = 2; $i <= 3; $i++ ) { 256 257 $this->go_to("/page/{$i}/"); … … 305 306 // 'search/(.+)/page/?([0-9]{1,})/?$' => 'index.php?s=$matches[1]&paged=$matches[2]', 306 307 function test_search_paged() { 307 $this->factory->post->create_many( 10, array( 'post_title' => 'test' ) ); 308 update_option( 'posts_per_page', 2 ); 309 $this->factory->post->create_many( 3, array( 'post_title' => 'test' ) ); 308 310 $this->go_to('/search/test/page/2/'); 309 311 $this->assertQueryTrue('is_search', 'is_paged'); … … 345 347 // 'category/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?category_name=$matches[1]&paged=$matches[2]', 346 348 function test_category_paged() { 347 $this->factory->post->create_many( 10 ); 349 update_option( 'posts_per_page', 2 ); 350 $this->factory->post->create_many( 3 ); 348 351 $this->go_to('/category/uncategorized/page/2/'); 349 352 $this->assertQueryTrue('is_archive', 'is_category', 'is_paged'); … … 378 381 // 'tag/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?tag=$matches[1]&paged=$matches[2]', 379 382 function test_tag_paged() { 380 $post_ids = $this->factory->post->create_many( 10 ); 383 update_option( 'posts_per_page', 2 ); 384 $post_ids = $this->factory->post->create_many( 3 ); 381 385 foreach ( $post_ids as $post_id ) 382 386 $this->factory->term->add_post_terms( $post_id, 'tag-a', 'post_tag' ); … … 424 428 // 'author/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?author_name=$matches[1]&paged=$matches[2]', 425 429 function test_author_paged() { 430 update_option( 'posts_per_page', 2 ); 426 431 $user_id = $this->factory->user->create( array( 'user_login' => 'user-a' ) ); 427 $this->factory->post->create_many( 10, array( 'post_author' => $user_id ) );432 $this->factory->post->create_many( 3, array( 'post_author' => $user_id ) ); 428 433 $this->go_to('/author/user-a/page/2/'); 429 434 $this->assertQueryTrue('is_archive', 'is_author', 'is_paged'); … … 465 470 // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]', 466 471 function test_ymd_paged() { 467 $this->factory->post->create_many( 10, array( 'post_date' => '2007-09-04 00:00:00' ) ); 472 update_option( 'posts_per_page', 2 ); 473 $this->factory->post->create_many( 3, array( 'post_date' => '2007-09-04 00:00:00' ) ); 468 474 $this->go_to('/2007/09/04/page/2/'); 469 475 $this->assertQueryTrue('is_archive', 'is_day', 'is_date', 'is_paged'); … … 498 504 // '([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]', 499 505 function test_ym_paged() { 500 $this->factory->post->create_many( 10, array( 'post_date' => '2007-09-04 00:00:00' ) ); 506 update_option( 'posts_per_page', 2 ); 507 $this->factory->post->create_many( 3, array( 'post_date' => '2007-09-04 00:00:00' ) ); 501 508 $this->go_to('/2007/09/page/2/'); 502 509 $this->assertQueryTrue('is_archive', 'is_date', 'is_month', 'is_paged'); … … 531 538 // '([0-9]{4})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&paged=$matches[2]', 532 539 function test_y_paged() { 533 $this->factory->post->create_many( 10, array( 'post_date' => '2007-09-04 00:00:00' ) ); 540 update_option( 'posts_per_page', 2 ); 541 $this->factory->post->create_many( 3, array( 'post_date' => '2007-09-04 00:00:00' ) ); 534 542 $this->go_to('/2007/page/2/'); 535 543 $this->assertQueryTrue('is_archive', 'is_date', 'is_year', 'is_paged');
Note: See TracChangeset
for help on using the changeset viewer.