| 523 | |
| 524 | function test_get_pages_include_exclude() { |
| 525 | $page_ids = array(); |
| 526 | |
| 527 | foreach ( range( 1, 20 ) as $i ) |
| 528 | $page_ids[] = $this->factory->post->create( array( 'post_type' => 'page' ) ); |
| 529 | |
| 530 | $inc = array_slice( $page_ids, 0, 10 ); |
| 531 | sort( $inc ); |
| 532 | $exc = array_slice( $page_ids, 10 ); |
| 533 | sort( $exc ); |
| 534 | |
| 535 | $include = get_pages( array( 'include' => $inc ) ); |
| 536 | $inc_result = wp_list_pluck( $include, 'ID' ); |
| 537 | sort( $inc_result ); |
| 538 | $this->assertEquals( $inc, $inc_result ); |
| 539 | |
| 540 | $exclude = get_pages( array( 'exclude' => $exc ) ); |
| 541 | $exc_result = wp_list_pluck( $exclude, 'ID' ); |
| 542 | sort( $exc_result ); |
| 543 | $this->assertEquals( $inc, $exc_result ); |
| 544 | } |