WordPress.org

Make WordPress Core

Changeset 960 in tests


Ignore:
Timestamp:
08/10/12 15:37:26 (21 months ago)
Author:
ryan
Message:

Test passing stdClass and WP_User to wp_update_user(). see #WP21429

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/user.php

    r956 r960  
    330330        $this->assertEquals( 'about me', $user->get( 'description' ) ); 
    331331 
     332        // Pass as stdClass 
     333        $user_data = array( 'ID' => $user_id, 'display_name' => 'a test user' ); 
     334        wp_update_user( (object) $user_data ); 
     335 
     336        $user = new WP_User( $user_id ); 
     337        $this->assertEquals( 'a test user', $user->get( 'display_name' ) ); 
     338 
     339        // Pass as WP_User 
     340        $user = new WP_User( $user_id ); 
     341        $user->display_name = 'some test user'; 
     342        wp_update_user( $user ); 
     343 
     344        $user = new WP_User( $user_id ); 
     345        $this->assertEquals( 'some test user', $user->get( 'display_name' ) ); 
     346 
    332347        // Test update of fields in _get_additional_user_keys() 
    333348        $user_data = array( 'ID' => $user_id, 'use_ssl' => 1, 'show_admin_bar_front' => 1, 
Note: See TracChangeset for help on using the changeset viewer.