Changeset 47648 for branches/4.9/tests/phpunit/tests/user.php
- Timestamp:
- 04/29/2020 04:15:39 PM (3 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
- Property svn:mergeinfo changed
/trunk merged: 47633-47635,47637-47638
- Property svn:mergeinfo changed
-
branches/4.9/tests/phpunit/tests/user.php
r43459 r47648 918 918 } 919 919 920 function test_changing_email_invalidates_password_reset_key() {920 public function test_changing_email_invalidates_password_reset_key() { 921 921 global $wpdb; 922 922 … … 943 943 'user_nicename' => 'cat', 944 944 'user_email' => 'foo@bar.dev', 945 ); 946 wp_update_user( $userdata ); 947 948 $user = get_userdata( $user->ID ); 949 $this->assertEmpty( $user->user_activation_key ); 950 } 951 952 public function test_changing_password_invalidates_password_reset_key() { 953 global $wpdb; 954 955 $user = $this->author; 956 $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) ); 957 clean_user_cache( $user ); 958 959 $user = get_userdata( $user->ID ); 960 $this->assertEquals( 'key', $user->user_activation_key ); 961 962 $userdata = array( 963 'ID' => $user->ID, 964 'user_pass' => 'password', 945 965 ); 946 966 wp_update_user( $userdata );
Note: See TracChangeset
for help on using the changeset viewer.