Changeset 42343 for trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php
- Timestamp:
- 11/30/2017 11:09:33 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php
r40417 r42343 45 45 function test_invalid_role() { 46 46 $administrator_id = $this->make_user_by_role( 'administrator' ); 47 if ( is_multisite() ) 47 if ( is_multisite() ) { 48 48 grant_super_admin( $administrator_id ); 49 } 49 50 50 $filter = array( 'role' => 'invalidrole' );51 $filter = array( 'role' => 'invalidrole' ); 51 52 $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) ); 52 53 $this->assertIXRError( $results ); … … 55 56 56 57 function test_role_filter() { 57 $author_id = $this->make_user_by_role( 'author' );58 $editor_id = $this->make_user_by_role( 'editor' );58 $author_id = $this->make_user_by_role( 'author' ); 59 $editor_id = $this->make_user_by_role( 'editor' ); 59 60 $administrator_id = $this->make_user_by_role( 'administrator' ); 60 if ( is_multisite() ) 61 if ( is_multisite() ) { 61 62 grant_super_admin( $administrator_id ); 63 } 62 64 63 65 // test a single role ('editor') 64 $filter = array( 'role' => 'editor' );66 $filter = array( 'role' => 'editor' ); 65 67 $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) ); 66 68 $this->assertNotIXRError( $results ); … … 69 71 70 72 // test 'authors', which should return all non-subscribers 71 $filter2 = array( 'who' => 'authors' );73 $filter2 = array( 'who' => 'authors' ); 72 74 $results2 = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter2 ) ); 73 75 $this->assertNotIXRError( $results2 ); … … 77 79 function test_paging_filters() { 78 80 $administrator_id = $this->make_user_by_role( 'administrator' ); 79 if ( is_multisite() ) 81 if ( is_multisite() ) { 80 82 grant_super_admin( $administrator_id ); 83 } 81 84 82 85 self::factory()->user->create_many( 5 ); … … 85 88 86 89 $users_found = array(); 87 $page_size = 2;90 $page_size = 2; 88 91 89 $filter = array( 'number' => $page_size, 'offset' => 0 ); 92 $filter = array( 93 'number' => $page_size, 94 'offset' => 0, 95 ); 90 96 do { 91 97 $presults = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) ); … … 103 109 $this->make_user_by_role( 'administrator' ); 104 110 105 $filter = array( 'orderby' => 'email', 'order' => 'ASC' ); 111 $filter = array( 112 'orderby' => 'email', 113 'order' => 'ASC', 114 ); 106 115 $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) ); 107 116 $this->assertNotIXRError( $results );
Note: See TracChangeset
for help on using the changeset viewer.