Changeset 47658 for branches/4.1/tests/phpunit/tests/user.php
- Timestamp:
- 04/29/2020 04:52:21 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1/tests/phpunit/tests/user.php
r30513 r47658 634 634 } 635 635 636 function test_changing_email_invalidates_password_reset_key() {636 public function test_changing_email_invalidates_password_reset_key() { 637 637 global $wpdb; 638 638 … … 665 665 $this->assertEmpty( $user->user_activation_key ); 666 666 } 667 668 public function test_changing_password_invalidates_password_reset_key() { 669 global $wpdb; 670 671 $user = $this->factory->user->create_and_get(); 672 $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) ); 673 clean_user_cache( $user ); 674 675 $user = get_userdata( $user->ID ); 676 $this->assertEquals( 'key', $user->user_activation_key ); 677 678 $userdata = array( 679 'ID' => $user->ID, 680 'user_pass' => 'password', 681 ); 682 wp_update_user( $userdata ); 683 684 $user = get_userdata( $user->ID ); 685 $this->assertEmpty( $user->user_activation_key ); 686 } 687 667 688 }
Note: See TracChangeset
for help on using the changeset viewer.