Changeset 33115
- Timestamp:
- 07/07/2015 07:28:46 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r33023 r33115 1946 1946 * accordingly. 1947 1947 */ 1948 if ( ( ! $update || ( ! empty( $old_user_data ) && $user_email !== $old_user_data->user_email) )1948 if ( ( ! $update || ( ! empty( $old_user_data ) && 0 !== strcasecmp( $user_email, $old_user_data->user_email ) ) ) 1949 1949 && ! defined( 'WP_IMPORTING' ) 1950 1950 && email_exists( $user_email ) -
trunk/tests/phpunit/tests/user.php
r32980 r33115 757 757 $this->assertTrue( in_array( $id, $users ) ); 758 758 } 759 760 /** 761 * @ticket 32158 762 */ 763 function test_email_case() { 764 // Create a test user with a lower-case email address. 765 $user_id = $this->factory->user->create( array( 766 'user_email' => 'test@test.com', 767 ) ); 768 769 // Alter the case of the email address (which stays the same). 770 $userdata = array( 771 'ID' => $user_id, 772 'user_email' => 'test@TEST.com', 773 ); 774 $update = wp_update_user( $userdata ); 775 776 $this->assertEquals( $user_id, $update ); 777 } 778 779 /** 780 * @ticket 32158 781 */ 782 function test_email_change() { 783 // Create a test user. 784 $user_id = $this->factory->user->create( array( 785 'user_email' => 'test@test.com', 786 ) ); 787 788 // Change the email address. 789 $userdata = array( 790 'ID' => $user_id, 791 'user_email' => 'test2@test.com', 792 ); 793 $update = wp_update_user( $userdata ); 794 795 // Was this successful? 796 $this->assertEquals( $user_id, $update ); 797 798 // Verify that the email address has been updated. 799 $user = get_userdata( $user_id ); 800 $this->assertEquals( $user->user_email, 'test2@test.com' ); 801 } 802 759 803 }
Note: See TracChangeset
for help on using the changeset viewer.