Changeset 42343 for trunk/tests/phpunit/tests/post/getPageChildren.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/getPageChildren.php
r32354 r42343 25 25 $this->pages = array( 26 26 0 => (object) array( 27 'ID' => 100,27 'ID' => 100, 28 28 'post_parent' => 0, 29 29 ), 30 30 1 => (object) array( 31 'ID' => 101,31 'ID' => 101, 32 32 'post_parent' => 100, 33 33 ), 34 34 2 => (object) array( 35 'ID' => 102,35 'ID' => 102, 36 36 'post_parent' => 100, 37 37 ), 38 38 3 => (object) array( 39 'ID' => 103,39 'ID' => 103, 40 40 'post_parent' => 101, 41 41 ), … … 43 43 // Not in the tree. 44 44 4 => (object) array( 45 'ID' => 104,45 'ID' => 104, 46 46 'post_parent' => 9898989898, 47 47 ), 48 48 49 49 5 => (object) array( 50 'ID' => 105,50 'ID' => 105, 51 51 'post_parent' => 100, 52 52 ), 53 53 6 => (object) array( 54 'ID' => 106,54 'ID' => 106, 55 55 'post_parent' => 102, 56 56 ), 57 57 7 => (object) array( 58 'ID' => 107,58 'ID' => 107, 59 59 'post_parent' => 106, 60 60 ), 61 61 8 => (object) array( 62 'ID' => 108,62 'ID' => 108, 63 63 'post_parent' => 107, 64 64 ), … … 68 68 public function test_page_id_0_should_return_all_pages_in_tree_and_exclude_pages_not_in_tree() { 69 69 $expected = array( 100, 101, 102, 103, 105, 106, 107, 108 ); 70 $actual = get_page_children( 0, $this->pages );70 $actual = get_page_children( 0, $this->pages ); 71 71 $this->assertEqualSets( $expected, wp_list_pluck( $actual, 'ID' ) ); 72 72 } … … 74 74 public function test_hierarchical_order_should_be_respected_in_results() { 75 75 $expected = array( 100, 101, 103, 102, 106, 107, 108, 105 ); 76 $actual = get_page_children( 0, $this->pages );76 $actual = get_page_children( 0, $this->pages ); 77 77 $this->assertEquals( $expected, wp_list_pluck( $actual, 'ID' ) ); 78 78 } … … 80 80 public function test_not_all_pages_should_be_returned_when_page_id_is_in_the_middle_of_the_tree() { 81 81 $expected = array( 106, 107, 108 ); 82 $actual = get_page_children( 102, $this->pages );82 $actual = get_page_children( 102, $this->pages ); 83 83 $this->assertEquals( $expected, wp_list_pluck( $actual, 'ID' ) ); 84 84 }
Note: See TracChangeset
for help on using the changeset viewer.