Changeset 42343 for trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php
r40417 r42343 13 13 // create a super-admin 14 14 $this->administrator_id = $this->make_user_by_role( 'administrator' ); 15 if ( is_multisite() ) 15 if ( is_multisite() ) { 16 16 grant_super_admin( $this->administrator_id ); 17 } 17 18 } 18 19 … … 55 56 function test_valid_user() { 56 57 $registered_date = strtotime( '-1 day' ); 57 $user_data = array(58 'user_login' => 'getusertestuser',59 'user_pass' => 'password',60 'first_name' => 'First',61 'last_name' => 'Last',62 'description' => 'I love WordPress',63 'user_email' => 'getUserTestUser@example.com',64 'nickname' => 'nickname',65 'user_nicename' => 'nicename',66 'display_name' => 'First Last',67 'user_url' => 'http://www.example.com/testuser',68 'role' => 'author',69 'aim' => 'wordpress',70 'user_registered' => strftime( "%Y-%m-%d %H:%M:%S", $registered_date )58 $user_data = array( 59 'user_login' => 'getusertestuser', 60 'user_pass' => 'password', 61 'first_name' => 'First', 62 'last_name' => 'Last', 63 'description' => 'I love WordPress', 64 'user_email' => 'getUserTestUser@example.com', 65 'nickname' => 'nickname', 66 'user_nicename' => 'nicename', 67 'display_name' => 'First Last', 68 'user_url' => 'http://www.example.com/testuser', 69 'role' => 'author', 70 'aim' => 'wordpress', 71 'user_registered' => strftime( '%Y-%m-%d %H:%M:%S', $registered_date ), 71 72 ); 72 $user_id = wp_insert_user( $user_data );73 $user_id = wp_insert_user( $user_data ); 73 74 74 75 $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $user_id ) ); … … 127 128 128 129 $expected_fields = array( 'user_id', 'username', 'email', 'registered', 'display_name', 'nicename' ); 129 $keys = array_keys( $result );130 $keys = array_keys( $result ); 130 131 sort( $expected_fields ); 131 132 sort( $keys ); … … 143 144 144 145 $expected_fields = array( 'user_id', 'email', 'bio' ); 145 $keys = array_keys( $result );146 $keys = array_keys( $result ); 146 147 sort( $expected_fields ); 147 148 sort( $keys );
Note: See TracChangeset
for help on using the changeset viewer.