Make WordPress Core

Ticket #42278: 42278.patch

File 42278.patch, 21.5 KB (added by Frank Klein, 7 years ago)
  • tests/phpunit/includes/bootstrap.php

    diff --git tests/phpunit/includes/bootstrap.php tests/phpunit/includes/bootstrap.php
    index 5d3e159685..29d9d0b66a 100644
    require_once ABSPATH . '/wp-settings.php'; 
    105105// Delete any default posts & related data
    106106_delete_all_posts();
    107107
     108require dirname( __FILE__ ) . '/shared-fixtures.php';
     109
     110// Create shared user fixtures.
     111_tests_create_shared_user_fixtures();
     112
    108113require dirname( __FILE__ ) . '/testcase.php';
    109114require dirname( __FILE__ ) . '/testcase-rest-api.php';
    110115require dirname( __FILE__ ) . '/testcase-rest-controller.php';
  • tests/phpunit/includes/functions.php

    diff --git tests/phpunit/includes/functions.php tests/phpunit/includes/functions.php
    index 9a450ece84..1ccd5ac99c 100644
    function _delete_all_data() { 
    7575
    7676        $wpdb->query( "UPDATE {$wpdb->term_taxonomy} SET count = 0" );
    7777
    78         $wpdb->query( "DELETE FROM {$wpdb->users} WHERE ID != 1" );
    79         $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE user_id != 1" );
     78
     79        $wpdb->query( "DELETE FROM {$wpdb->users} WHERE ID != 1 AND ID != 2 AND ID != 3 AND ID != 4 AND ID != 5" );
     80        $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE user_id != 1 AND user_id != 2 AND user_id != 3 AND user_id != 4 AND user_id != 5" );
    8081}
    8182
    8283function _delete_all_posts() {
  • new file tests/phpunit/includes/shared-fixtures.php

    diff --git tests/phpunit/includes/shared-fixtures.php tests/phpunit/includes/shared-fixtures.php
    new file mode 100644
    index 0000000000..30fd4f0301
    - +  
     1<?php
     2
     3function _tests_create_shared_user_fixtures() {
     4        // Editor.
     5        wp_insert_user( array(
     6                'role'       => 'editor',
     7                'user_email' => 'editor_user@example.org',
     8                'user_login' => 'editor_user',
     9                'user_pass'  => 'password',
     10        ) );
     11
     12        // Author.
     13        wp_insert_user( array(
     14                'role'       => 'author',
     15                'user_email' => 'author_user@example.org',
     16                'user_login' => 'author_user',
     17                'user_pass'  => 'password',
     18        ) );
     19
     20        // Contributor.
     21        wp_insert_user( array(
     22                'role'       => 'contributor',
     23                'user_email' => 'contributor_user@example.org',
     24                'user_login' => 'contributor_user',
     25                'user_pass'  => 'password',
     26        ) );
     27
     28        // Subscriber.
     29        wp_insert_user( array(
     30                'role'       => 'subscriber',
     31                'user_email' => 'subscriber_user@example.org',
     32                'user_login' => 'subscriber_user',
     33                'user_pass'  => 'password',
     34        ) );
     35}
     36
     37function tests_get_shared_admin_user() {
     38        static $admin;
     39
     40        if ( ! $admin ) {
     41                $admin = get_user_by( 'id', 1 );
     42        }
     43
     44        return $admin;
     45}
     46
     47function tests_get_shared_editor_user() {
     48        static $editor;
     49
     50        if ( ! $editor ) {
     51                $editor = get_user_by( 'id', 2 );
     52        }
     53
     54        return $editor;
     55}
     56
     57function tests_get_shared_author_user() {
     58        static $author;
     59
     60        if ( ! $author ) {
     61                $author = get_user_by( 'id', 3 );
     62        }
     63
     64        return $author;
     65}
     66
     67function tests_get_shared_contributor_user() {
     68        static $contributor;
     69
     70        if ( ! $contributor ) {
     71                $contributor = get_user_by( 'id', 4 );
     72        }
     73
     74        return $contributor;
     75}
     76
     77function tests_get_shared_subscriber_user() {
     78        static $subscriber;
     79
     80        if ( ! $subscriber ) {
     81                $subscriber = get_user_by( 'id', 5 );
     82        }
     83
     84        return $subscriber;
     85}
     86
  • new file tests/phpunit/tests/includes/shared-fixtures.php

    diff --git tests/phpunit/tests/includes/shared-fixtures.php tests/phpunit/tests/includes/shared-fixtures.php
    new file mode 100644
    index 0000000000..0081f89686
    - +  
     1<?php
     2
     3/**
     4 * @group testsuite
     5 */
     6class Test_Shared_Fixtures extends WP_UnitTestCase {
     7
     8        public function test_get_shared_admin_user() {
     9                $admin = tests_get_shared_admin_user();
     10
     11                $this->assertSame( 'administrator', $admin->roles[0] );
     12        }
     13
     14        public function test_get_shared_editor_user() {
     15                $editor = tests_get_shared_editor_user();
     16
     17                $this->assertSame( 'editor', $editor->roles[0] );
     18        }
     19
     20        public function test_get_shared_author_user() {
     21                $author = tests_get_shared_author_user();
     22
     23                $this->assertSame( 'author', $author->roles[0] );
     24        }
     25
     26        public function test_get_shared_contributor_user() {
     27                $contributor = tests_get_shared_contributor_user();
     28
     29                $this->assertSame( 'contributor', $contributor->roles[0] );
     30        }
     31
     32        public function test_get_shared_subscriber_user() {
     33                $subscriber = tests_get_shared_subscriber_user();
     34
     35                $this->assertSame( 'subscriber', $subscriber->roles[0] );
     36        }
     37}
  • tests/phpunit/tests/meta.php

    diff --git tests/phpunit/tests/meta.php tests/phpunit/tests/meta.php
    index b436630af7..ed4e9461ed 100644
    class Tests_Meta extends WP_UnitTestCase { 
    137137                        )
    138138                );
    139139
    140                 $this->assertEquals( 1, count( $u ) );
     140                $this->assertEquals( 5, count( $u ) );
    141141
    142142                // User found is not locally defined author (it's the admin)
    143143                $this->assertNotEquals( $this->author->user_login, $u[0]->user_login );
    class Tests_Meta extends WP_UnitTestCase { 
    163163                );
    164164
    165165                $this->assertEquals(
    166                         2, count(
     166                        6, count(
    167167                                get_users(
    168168                                        array(
    169169                                                'meta_query' => array(
    class Tests_Meta extends WP_UnitTestCase { 
    180180                delete_metadata( 'user', $this->author->ID, 'meta_key' );
    181181
    182182                $this->assertEquals(
    183                         2, count(
     183                        6, count(
    184184                                get_users(
    185185                                        array(
    186186                                                'meta_query' => array(
  • tests/phpunit/tests/rest-api/rest-users-controller.php

    diff --git tests/phpunit/tests/rest-api/rest-users-controller.php tests/phpunit/tests/rest-api/rest-users-controller.php
    index 7b81eb1240..a4ba4b2482 100644
    class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { 
    280280                $request  = new WP_REST_Request( 'GET', '/wp/v2/users' );
    281281                $response = $this->server->dispatch( $request );
    282282                $headers  = $response->get_headers();
    283                 $this->assertEquals( 53, $headers['X-WP-Total'] );
     283                $this->assertEquals( 57, $headers['X-WP-Total'] );
    284284                $this->assertEquals( 6, $headers['X-WP-TotalPages'] );
    285285                $next_link = add_query_arg(
    286286                        array(
    class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { 
    299299                $request->set_param( 'page', 3 );
    300300                $response = $this->server->dispatch( $request );
    301301                $headers  = $response->get_headers();
    302                 $this->assertEquals( 54, $headers['X-WP-Total'] );
     302                $this->assertEquals( 58, $headers['X-WP-Total'] );
    303303                $this->assertEquals( 6, $headers['X-WP-TotalPages'] );
    304304                $prev_link = add_query_arg(
    305305                        array(
    class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { 
    318318                $request->set_param( 'page', 6 );
    319319                $response = $this->server->dispatch( $request );
    320320                $headers  = $response->get_headers();
    321                 $this->assertEquals( 54, $headers['X-WP-Total'] );
     321                $this->assertEquals( 58, $headers['X-WP-Total'] );
    322322                $this->assertEquals( 6, $headers['X-WP-TotalPages'] );
    323323                $prev_link = add_query_arg(
    324324                        array(
    class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { 
    332332                $request->set_param( 'page', 8 );
    333333                $response = $this->server->dispatch( $request );
    334334                $headers  = $response->get_headers();
    335                 $this->assertEquals( 54, $headers['X-WP-Total'] );
     335                $this->assertEquals( 58, $headers['X-WP-Total'] );
    336336                $this->assertEquals( 6, $headers['X-WP-TotalPages'] );
    337337                $prev_link = add_query_arg(
    338338                        array(
    class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { 
    530530                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
    531531                $request->set_param( 'offset', 1 );
    532532                $response = $this->server->dispatch( $request );
    533                 $this->assertCount( 9, $response->get_data() );
     533                $this->assertCount( 10, $response->get_data() );
    534534                // 'offset' works with 'per_page'
    535535                $request->set_param( 'per_page', 2 );
    536536                $response = $this->server->dispatch( $request );
    class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { 
    728728        // Note: Do not test using editor role as there is an editor role created in testing and it makes it hard to test this functionality.
    729729        public function test_get_items_roles() {
    730730                wp_set_current_user( self::$user );
    731                 $tango   = $this->factory->user->create(
    732                         array(
    733                                 'display_name' => 'tango',
    734                                 'role'         => 'subscriber',
    735                         )
    736                 );
    737                 $yolo    = $this->factory->user->create(
    738                         array(
    739                                 'display_name' => 'yolo',
    740                                 'role'         => 'author',
    741                         )
    742                 );
     731
    743732                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
    744733                $request->set_param( 'roles', 'author,subscriber' );
    745734                $response = $this->server->dispatch( $request );
    746735                $data     = $response->get_data();
    747736                $this->assertEquals( 2, count( $data ) );
    748                 $this->assertEquals( $tango, $data[0]['id'] );
    749                 $this->assertEquals( $yolo, $data[1]['id'] );
     737                $this->assertEquals( tests_get_shared_author_user()->ID, $data[0]['id'] );
     738                $this->assertEquals( tests_get_shared_subscriber_user()->ID, $data[1]['id'] );
     739
    750740                $request->set_param( 'roles', 'author' );
    751741                $response = $this->server->dispatch( $request );
    752742                $data     = $response->get_data();
    753743                $this->assertEquals( 1, count( $data ) );
    754                 $this->assertEquals( $yolo, $data[0]['id'] );
     744                $this->assertEquals( tests_get_shared_author_user()->ID, $data[0]['id'] );
    755745                wp_set_current_user( 0 );
    756746                $request->set_param( 'roles', 'author' );
    757747                $response = $this->server->dispatch( $request );
    class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { 
    764754
    765755        public function test_get_items_invalid_roles() {
    766756                wp_set_current_user( self::$user );
    767                 $lolz    = $this->factory->user->create(
    768                         array(
    769                                 'display_name' => 'lolz',
    770                                 'role'         => 'author',
    771                         )
    772                 );
     757
    773758                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
    774759                $request->set_param( 'roles', 'ilovesteak,author' );
    775760                $response = $this->server->dispatch( $request );
    776761                $data     = $response->get_data();
    777762                $this->assertEquals( 1, count( $data ) );
    778                 $this->assertEquals( $lolz, $data[0]['id'] );
     763                $this->assertEquals( tests_get_shared_author_user()->ID, $data[0]['id'] );
     764
    779765                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
    780766                $request->set_param( 'roles', 'steakisgood' );
    781767                $response = $this->server->dispatch( $request );
  • tests/phpunit/tests/user/countUsers.php

    diff --git tests/phpunit/tests/user/countUsers.php tests/phpunit/tests/user/countUsers.php
    index 8d1efad61a..4b02203865 100644
    class Tests_User_CountUsers extends WP_UnitTestCase { 
    1212         * @group ms-excluded
    1313         */
    1414        public function test_count_users_is_accurate( $strategy ) {
    15                 // Setup users
    16                 $admin       = self::factory()->user->create(
    17                         array(
    18                                 'role' => 'administrator',
    19                         )
    20                 );
    21                 $editor      = self::factory()->user->create(
    22                         array(
    23                                 'role' => 'editor',
    24                         )
    25                 );
    26                 $author      = self::factory()->user->create(
    27                         array(
    28                                 'role' => 'author',
    29                         )
    30                 );
    31                 $contributor = self::factory()->user->create(
    32                         array(
    33                                 'role' => 'contributor',
    34                         )
    35                 );
    36                 $subscriber  = self::factory()->user->create(
    37                         array(
    38                                 'role' => 'subscriber',
    39                         )
    40                 );
    4115                $none        = self::factory()->user->create(
    4216                        array(
    4317                                'role' => '',
    class Tests_User_CountUsers extends WP_UnitTestCase { 
    5226                // Test user counts
    5327                $count = count_users( $strategy );
    5428
    55                 $this->assertEquals( 8, $count['total_users'] );
     29                $this->assertEquals( 7, $count['total_users'] );
    5630                $this->assertEquals(
    5731                        array(
    58                                 'administrator' => 2,
     32                                'administrator' => 1,
    5933                                'editor'        => 1,
    6034                                'author'        => 1,
    6135                                'contributor'   => 1,
    class Tests_User_CountUsers extends WP_UnitTestCase { 
    131105                // Test users counts on root site
    132106                $count = count_users( $strategy );
    133107
    134                 $this->assertEquals( 8, $count['total_users'] );
     108                $this->assertEquals( 12, $count['total_users'] );
    135109                $this->assertEquals(
    136110                        array(
    137111                                'administrator' => 2,
    138                                 'editor'        => 1,
    139                                 'author'        => 1,
    140                                 'contributor'   => 1,
    141                                 'subscriber'    => 1,
     112                                'editor'        => 2,
     113                                'author'        => 2,
     114                                'contributor'   => 2,
     115                                'subscriber'    => 2,
    142116                                'none'          => 2,
    143117                        ), $count['avail_roles']
    144118                );
    class Tests_User_CountUsers extends WP_UnitTestCase { 
    207181         * @dataProvider data_count_users_strategies
    208182         */
    209183        public function test_count_users_is_accurate_with_multiple_roles( $strategy ) {
    210 
    211                 // Setup users
    212                 $admin  = self::factory()->user->create(
    213                         array(
    214                                 'role' => 'administrator',
    215                         )
    216                 );
     184                // Setup user
    217185                $editor = self::factory()->user->create(
    218186                        array(
    219187                                'role' => 'editor',
    class Tests_User_CountUsers extends WP_UnitTestCase { 
    232200                // Test user counts
    233201                $count = count_users( $strategy );
    234202
    235                 $this->assertEquals( 3, $count['total_users'] );
     203                $this->assertEquals( 6, $count['total_users'] );
    236204                $this->assertEquals(
    237205                        array(
    238                                 'administrator' => 2,
    239                                 'editor'        => 1,
    240                                 'author'        => 1,
     206                                'administrator' => 1,
     207                                'editor'        => 2,
     208                                'author'        => 2,
     209                                'contributor'   => 1,
     210                                'subscriber'    => 1,
    241211                                'none'          => 0,
    242212                        ), $count['avail_roles']
    243213                );
  • tests/phpunit/tests/user/listAuthors.php

    diff --git tests/phpunit/tests/user/listAuthors.php tests/phpunit/tests/user/listAuthors.php
    index 1568c34680..14881ba1a9 100644
    class Tests_User_ListAuthors extends WP_UnitTestCase { 
    148148
    149149        function test_wp_list_authors_hide_empty() {
    150150                $fred_id                = self::$fred_id;
    151                 $expected['hide_empty'] = '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a></li><li><a href="' . get_author_posts_url( $fred_id ) . '" title="Posts by fred">fred</a></li><li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a></li><li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a></li>';
     151                $expected['hide_empty']  = '<li><a href="' . get_author_posts_url( tests_get_shared_author_user()->ID ) . '" title="Posts by ' . tests_get_shared_author_user()->user_nicename . '">' . tests_get_shared_author_user()->user_nicename . '</a></li>';
     152                $expected['hide_empty'] .= '<li><a href="' . self::$user_urls[1] . '" title="Posts by bob">bob</a></li>';
     153                $expected['hide_empty'] .= '<li><a href="' . get_author_posts_url( tests_get_shared_contributor_user()->ID ) . '" title="Posts by ' . tests_get_shared_contributor_user()->user_nicename . '">' . tests_get_shared_contributor_user()->user_nicename . '</a></li>';
     154                $expected['hide_empty'] .= '<li><a href="' . get_author_posts_url( tests_get_shared_editor_user()->ID ) . '" title="Posts by ' . tests_get_shared_editor_user()->user_nicename . '">' . tests_get_shared_editor_user()->user_nicename . '</a></li>';
     155                $expected['hide_empty'] .= '<li><a href="' . get_author_posts_url( $fred_id ) . '" title="Posts by fred">fred</a></li>';
     156                $expected['hide_empty'] .= '<li><a href="' . self::$user_urls[2] . '" title="Posts by paul">paul</a></li>';
     157                $expected['hide_empty'] .= '<li><a href="' . get_author_posts_url( tests_get_shared_subscriber_user()->ID ) . '" title="Posts by ' . tests_get_shared_subscriber_user()->user_nicename . '">' . tests_get_shared_subscriber_user()->user_nicename . '</a></li>';
     158                $expected['hide_empty'] .= '<li><a href="' . self::$user_urls[0] . '" title="Posts by zack">zack</a></li>';
     159
    152160                $this->AssertEquals(
    153161                        $expected['hide_empty'], wp_list_authors(
    154162                                array(
  • tests/phpunit/tests/user/query.php

    diff --git tests/phpunit/tests/user/query.php tests/phpunit/tests/user/query.php
    index 64c110606e..34f0371bba 100644
    class Tests_User_Query extends WP_UnitTestCase { 
    131131                $users = $users->get_results();
    132132
    133133                // +1 for the default user created during installation.
    134                 $this->assertEquals( 13, count( $users ) );
     134                $this->assertEquals( 17, count( $users ) );
    135135                foreach ( $users as $user ) {
    136136                        $this->assertInstanceOf( 'WP_User', $user );
    137137                }
    class Tests_User_Query extends WP_UnitTestCase { 
    143143                        )
    144144                );
    145145                $users = $users->get_results();
    146                 $this->assertEquals( 13, count( $users ) );
     146                $this->assertEquals( 17, count( $users ) );
    147147                foreach ( $users as $user ) {
    148148                        $this->assertInstanceOf( 'WP_User', $user );
    149149                }
    class Tests_User_Query extends WP_UnitTestCase { 
    156156                $users       = new WP_User_Query( array( 'blog_id' => get_current_blog_id() ) );
    157157                $total_users = $users->get_total();
    158158
    159                 $this->assertSame( 13, $total_users );
     159                $this->assertSame( 17, $total_users );
    160160        }
    161161
    162162        /**
    class Tests_User_Query extends WP_UnitTestCase { 
    496496                // +1 for the default user created by the test suite.
    497497                $users = new WP_User_Query( array( 'blog_id' => get_current_blog_id() ) );
    498498                $users = $users->get_results();
    499                 $this->assertEquals( 13, count( $users ) );
     499                $this->assertEquals( 17, count( $users ) );
    500500
    501501                $users = new WP_User_Query(
    502502                        array(
    class Tests_User_Query extends WP_UnitTestCase { 
    523523                        )
    524524                );
    525525                $users = $users->get_results();
    526                 $this->assertEquals( 13, count( $users ) );
     526                $this->assertEquals( 17, count( $users ) );
    527527        }
    528528
    529529        /**
    class Tests_User_Query extends WP_UnitTestCase { 
    11331133                );
    11341134
    11351135                $foundCount    = count( $q->get_results() );
    1136                 $expectedCount = 10; // 13 total users minus 3 from query
     1136                $expectedCount = 14; // 13 total users minus 3 from query
    11371137
    11381138                $this->assertContains( "AND user_nicename NOT IN ( 'peter','paul','mary' )", $q->query_where );
    11391139                $this->assertEquals( $expectedCount, $foundCount );
    class Tests_User_Query extends WP_UnitTestCase { 
    12341234                );
    12351235
    12361236                $foundCount    = count( $q->get_results() );
    1237                 $expectedCount = 10; // 13 total users minus 3 from query
     1237                $expectedCount = 14; // 13 total users minus 3 from query
    12381238
    12391239                $this->assertContains( "AND user_login NOT IN ( '$user_login1','$user_login2','$user_login3' )", $q->query_where );
    12401240                $this->assertEquals( $expectedCount, $foundCount );
    class Tests_User_Query extends WP_UnitTestCase { 
    13081308                $wp_user_search = new WP_User_Query( array( 'role' => 'subscriber' ) );
    13091309                $users          = $wp_user_search->get_results();
    13101310
    1311                 $this->assertEquals( 2, count( $users ) );
     1311                $this->assertEquals( 3, count( $users ) );
    13121312        }
    13131313
    13141314        /**
    class Tests_User_Query extends WP_UnitTestCase { 
    13171317        public function test_get_multiple_roles_by_user_query() {
    13181318                $wp_user_search = new WP_User_Query( array( 'role__in' => array( 'subscriber', 'editor' ) ) );
    13191319                $users          = $wp_user_search->get_results();
    1320                 $this->assertEquals( 5, count( $users ) );
     1320                $this->assertEquals( 7, count( $users ) );
    13211321        }
    13221322
    13231323        /**
    class Tests_User_Query extends WP_UnitTestCase { 
    13301330                        )
    13311331                );
    13321332
    1333                 $this->assertEquals( 2, count( $users ) );
     1333                $this->assertEquals( 3, count( $users ) );
    13341334        }
    13351335
    13361336        /**
    class Tests_User_Query extends WP_UnitTestCase { 
    13521352                        )
    13531353                );
    13541354
    1355                 $this->assertEqualSets( self::$editor_ids, $users );
     1355                $this->assertEqualSets( array_merge( array( tests_get_shared_editor_user()->ID ), self::$editor_ids) , $users );
    13561356        }
    13571357
    13581358
    class Tests_User_Query extends WP_UnitTestCase { 
    13661366                        )
    13671367                );
    13681368
    1369                 $this->assertEquals( 2, count( $users ) );
     1369                $this->assertEquals( 3, count( $users ) );
    13701370        }
    13711371
    13721372        /**
    class Tests_User_Query extends WP_UnitTestCase { 
    14011401                $users = $users->get_results();
    14021402
    14031403                // +1 for the default user created during installation.
    1404                 $this->assertEquals( 8, count( $users ) );
     1404                $this->assertEquals( 10, count( $users ) );
    14051405                foreach ( $users as $user ) {
    14061406                        $this->assertInstanceOf( 'WP_User', $user );
    14071407                }
    class Tests_User_Query extends WP_UnitTestCase { 
    14911491                );
    14921492
    14931493                // +1 for the default user created during installation.
    1494                 $this->assertEquals( 11, count( $users ) );
     1494                $this->assertEquals( 14, count( $users ) );
    14951495
    14961496                $users = get_users(
    14971497                        array(
    class Tests_User_Query extends WP_UnitTestCase { 
    15001500                );
    15011501
    15021502                // +1 for the default user created during installation.
    1503                 $this->assertEquals( 10, count( $users ) );
     1503                $this->assertEquals( 13, count( $users ) );
    15041504        }
    15051505
    15061506        /**
    class Tests_User_Query extends WP_UnitTestCase { 
    15181518                        )
    15191519                );
    15201520
    1521                 $this->assertEquals( 5, count( $users ) );
     1521                $this->assertEquals( 6, count( $users ) );
    15221522
    15231523                $users = get_users(
    15241524                        array(
    class Tests_User_Query extends WP_UnitTestCase { 
    15271527                        )
    15281528                );
    15291529
    1530                 $this->assertEquals( 3, count( $users ) );
     1530                $this->assertEquals( 4, count( $users ) );
    15311531        }
    15321532
    15331533        /**
    class Tests_User_Query extends WP_UnitTestCase { 
    15441544                        )
    15451545                );
    15461546
    1547                 $this->assertEquals( 1, count( $users ) );
     1547                $this->assertEquals( 2, count( $users ) );
    15481548        }
    15491549
    15501550        /**
    class Tests_User_Query extends WP_UnitTestCase { 
    15621562                );
    15631563
    15641564                // +1 for the default user created during installation.
    1565                 $this->assertEquals( 12, count( $users ) );
     1565                $this->assertEquals( 15, count( $users ) );
    15661566
    15671567                $users = get_users(
    15681568                        array(
    class Tests_User_Query extends WP_UnitTestCase { 
    15711571                );
    15721572
    15731573                // +1 for the default user created during installation.
    1574                 $this->assertEquals( 10, count( $users ) );
     1574                $this->assertEquals( 13, count( $users ) );
    15751575        }
    15761576
    15771577        /**
  • tests/phpunit/tests/xmlrpc/wp/getUsers.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getUsers.php tests/phpunit/tests/xmlrpc/wp/getUsers.php
    index bddafcf39a..192b4b38d8 100644
    class Tests_XMLRPC_wp_getUsers extends WP_XMLRPC_UnitTestCase { 
    6666                $filter  = array( 'role' => 'editor' );
    6767                $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
    6868                $this->assertNotIXRError( $results );
    69                 $this->assertCount( 1, $results );
     69                $this->assertCount( 2, $results );
    7070                $this->assertEquals( $editor_id, $results[0]['user_id'] );
    7171
    7272                // test 'authors', which should return all non-subscribers