Changeset 47660 for branches/3.9/tests/phpunit/tests/user.php
- Timestamp:
- 04/29/2020 04:55:29 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9/tests/phpunit/tests/user.php
r47329 r47660 589 589 } 590 590 591 function test_changing_email_invalidates_password_reset_key() {591 public function test_changing_email_invalidates_password_reset_key() { 592 592 global $wpdb; 593 593 … … 620 620 $this->assertEmpty( $user->user_activation_key ); 621 621 } 622 623 public function test_changing_password_invalidates_password_reset_key() { 624 global $wpdb; 625 626 $user = $this->factory->user->create_and_get(); 627 $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) ); 628 clean_user_cache( $user ); 629 630 $user = get_userdata( $user->ID ); 631 $this->assertEquals( 'key', $user->user_activation_key ); 632 633 $userdata = array( 634 'ID' => $user->ID, 635 'user_pass' => 'password', 636 ); 637 wp_update_user( $userdata ); 638 639 $user = get_userdata( $user->ID ); 640 $this->assertEmpty( $user->user_activation_key ); 641 } 642 622 643 }
Note: See TracChangeset
for help on using the changeset viewer.