Make WordPress Core

Changeset 35137


Ignore:
Timestamp:
10/13/2015 03:31:26 PM (9 years ago)
Author:
boonebgorges
Message:

Create fewer fixtures in some XML-RPC tests.

See #30017, #33968.

Location:
trunk/tests/phpunit/tests/xmlrpc/wp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php

    r26087 r35137  
    5353
    5454        $post_ids = array();
    55         $num_posts = 17;
     55        $num_posts = 4;
    5656        foreach ( range( 1, $num_posts ) as $i ) {
    5757            $post_ids[] = $this->factory->post->create( array(
     
    6868        // page through results
    6969        $posts_found = array();
    70         $filter['number'] = 5;
     70        $filter['number'] = 2;
    7171        $filter['offset'] = 0;
    7272        do {
     
    7979
    8080        // add comments to some of the posts
    81         $random_posts = array_rand( $post_ids, $num_posts / 2 );
    82         foreach ( $random_posts as $i ) {
    83             $post = $post_ids[$i];
    84             $this->factory->comment->create_post_comments( $post, rand( 1, 20 ) );
     81        foreach ( $post_ids as $key => $post_id ) {
     82            // Larger post IDs will get more comments.
     83            $this->factory->comment->create_post_comments( $post_id, $key );
    8584        }
    8685
     
    9796
    9897        // set one of the posts to draft and get drafts
    99         $post = get_post( $post_ids[$random_posts[0]] );
     98        $post = get_post( $post_ids[0] );
    10099        $post->post_status = 'draft';
    101100        wp_update_post( $post );
  • trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php

    r25002 r35137  
    8080            grant_super_admin( $administrator_id );
    8181
    82         $this->factory->user->create_many( 13 );
     82        $this->factory->user->create_many( 5 );
    8383
    8484        $user_ids = get_users( array( 'fields' => 'ID' ) );
    8585
    8686        $users_found = array();
    87         $page_size = floor( count( $user_ids ) / 3 );
     87        $page_size = 2;
    8888
    8989        $filter = array( 'number' => $page_size, 'offset' => 0 );
Note: See TracChangeset for help on using the changeset viewer.