Changeset 38413 for trunk/tests/phpunit/tests/query/conditionals.php
- Timestamp:
- 08/28/2016 02:01:53 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/conditionals.php
r38407 r38413 33 33 } 34 34 35 function test_page_on_front() { 36 $page_on_front = self::factory()->post->create( array( 37 'post_type' => 'page', 38 ) ); 39 $page_for_posts = self::factory()->post->create( array( 40 'post_type' => 'page', 41 ) ); 42 update_option( 'show_on_front', 'page' ); 43 update_option( 'page_on_front', $page_on_front ); 44 update_option( 'page_for_posts', $page_for_posts ); 45 46 $this->go_to( '/' ); 47 $this->assertQueryTrue( 'is_front_page', 'is_page', 'is_singular' ); 48 49 $this->go_to( get_permalink( $page_for_posts ) ); 50 $this->assertQueryTrue( 'is_home', 'is_posts_page' ); 51 52 update_option( 'show_on_front', 'posts' ); 53 delete_option( 'page_on_front' ); 54 delete_option( 'page_for_posts' ); 55 } 56 35 57 function test_404() { 36 58 $this->go_to('/'.rand_str()); … … 199 221 } 200 222 201 // FIXME: what is this for?202 223 // '(about)(/[0-9]+)?/?$' => 'index.php?pagename=$matches[1]&page=$matches[2]' 203 224 function test_pagination_of_posts_page() { … … 213 234 global $wp_query; 214 235 $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID ); 236 237 update_option( 'show_on_front', 'posts' ); 238 delete_option( 'page_for_posts' ); 215 239 } 216 240 … … 330 354 function test_category_feed() { 331 355 self::factory()->term->create( array( 'name' => 'cat-a', 'taxonomy' => 'category' ) ); 356 332 357 // check the long form 333 358 $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
Note: See TracChangeset
for help on using the changeset viewer.