Changeset 25244 for trunk/tests/phpunit/tests/post.php
- Timestamp:
- 09/04/2013 08:55:05 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post.php
r25168 r25244 824 824 $this->assertEquals( $inc, $exc_result ); 825 825 } 826 827 function test_get_pages_parent() { 828 $page_id1 = $this->factory->post->create( array( 'post_type' => 'page' ) ); 829 $page_id2 = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_id1 ) ); 830 $page_id3 = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_id2 ) ); 831 $page_id4 = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_id1 ) ); 832 833 $pages = get_pages( array( 'parent' => 0, 'hierarchical' => false ) ); 834 $this->assertEqualSets( array( $page_id1 ), wp_list_pluck( $pages, 'ID' ) ); 835 836 $pages = get_pages( array( 'parent' => $page_id1, 'hierarchical' => false ) ); 837 $this->assertEqualSets( array( $page_id2, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); 838 839 $pages = get_pages( array( 'parent' => array( $page_id1, $page_id2 ), 'hierarchical' => false ) ); 840 $this->assertEqualSets( array( $page_id2, $page_id3, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); 841 842 $pages = get_pages( array( 'parent' => 0 ) ); 843 $this->assertEqualSets( array( $page_id1 ), wp_list_pluck( $pages, 'ID' ) ); 844 845 $pages = get_pages( array( 'parent' => $page_id1 ) ); 846 $this->assertEqualSets( array( $page_id2, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); 847 848 $pages = get_pages( array( 'parent' => array( $page_id1, $page_id2 ) ) ); 849 $this->assertEqualSets( array( $page_id2, $page_id3, $page_id4 ), wp_list_pluck( $pages, 'ID' ) ); 850 } 826 851 }
Note: See TracChangeset
for help on using the changeset viewer.