Make WordPress Core

Ticket #56256: 56256.test.diff

File 56256.test.diff, 947 bytes (added by johnregan3, 3 years ago)

Unit Test for 56256

  • tests/phpunit/tests/xmlrpc/wp/getUsers.php

    diff --git tests/phpunit/tests/xmlrpc/wp/getUsers.php tests/phpunit/tests/xmlrpc/wp/getUsers.php
    index 0cf340c0d6..51c743d371 100644
    class Tests_XMLRPC_wp_getUsers extends WP_XMLRPC_UnitTestCase { 
    7979                $this->assertCount( 3, array_intersect( array( $author_id, $editor_id, $administrator_id ), wp_list_pluck( $results2, 'user_id' ) ) );
    8080        }
    8181
     82        /**
     83         * @ticket 56256
     84         */
     85        public function test_multiple_capabilities() {
     86                $this->make_user_by_role( 'administrator' );
     87                $this->make_user_by_role( 'author' );
     88
     89                $users = get_users(
     90                        array(
     91                                'capability' => array(
     92                                        'edit_posts',
     93                                        'edit_pages'
     94                                ),
     95                                'fields' => 'ID'
     96                        )
     97                );
     98                $this->assertCount( 2, $users );
     99        }
     100
    82101        public function test_paging_filters() {
    83102                $administrator_id = $this->make_user_by_role( 'administrator' );
    84103                if ( is_multisite() ) {