Ticket #25750: 25750.1.test.diff
File 25750.1.test.diff, 895 bytes (added by , 11 years ago) |
---|
-
tests/phpunit/tests/post/getPages.php
2 2 3 3 /** 4 4 * @group post 5 * @group get_pages 5 6 */ 6 7 7 8 class Tests_Post_getPages extends WP_UnitTestCase { … … 9 10 parent::setUp(); 10 11 } 11 12 13 function test_hierarchical() { 14 $pages = $this->factory->post->create_many( 2, array( 'post_type' => 'page' ) ); 15 16 // Make the first post a child of the second 17 wp_update_post( array( 18 'ID' => $pages[0], 19 'post_parent' => $pages[1], 20 ) ); 21 22 $got_pages = get_pages(); 23 24 // Now the second post should be in front of the first 25 $this->assertEquals( $pages[0], $got_pages[1]->ID ); 26 $this->assertEquals( $pages[1], $got_pages[0]->ID ); 27 28 } 29 12 30 /** 13 31 * @ticket 23167 14 32 */