Changeset 26087
- Timestamp:
- 11/11/2013 05:45:36 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php
r25002 r26087 52 52 )); 53 53 54 $post_ids = array(); 54 55 $num_posts = 17; 55 $post_ids = $this->factory->post->create_many( $num_posts, array( 'post_type' => $cpt_name ) ); 56 56 foreach ( range( 1, $num_posts ) as $i ) { 57 $post_ids[] = $this->factory->post->create( array( 58 'post_type' => $cpt_name, 59 'post_date' => date( 'Y-m-d H:i:s', time() + $i ) 60 ) ); 61 } 57 62 // get them all 58 63 $filter = array( 'post_type' => $cpt_name, 'number' => $num_posts + 10 ); … … 67 72 do { 68 73 $presults = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) ); 69 foreach( $presults as $post ) { 70 $posts_found[] = $post['post_id']; 71 } 74 $posts_found = array_merge( $posts_found, wp_list_pluck( $presults, 'post_id' ) ); 72 75 $filter['offset'] += $filter['number']; 73 76 } while ( count( $presults ) > 0 );
Note: See TracChangeset
for help on using the changeset viewer.