Changeset 47659 for branches/4.0/tests/phpunit/tests/user.php
- Timestamp:
- 04/29/2020 04:53:40 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.0/tests/phpunit/tests/user.php
r40455 r47659 616 616 } 617 617 618 function test_changing_email_invalidates_password_reset_key() {618 public function test_changing_email_invalidates_password_reset_key() { 619 619 global $wpdb; 620 620 … … 647 647 $this->assertEmpty( $user->user_activation_key ); 648 648 } 649 650 public function test_changing_password_invalidates_password_reset_key() { 651 global $wpdb; 652 653 $user = $this->factory->user->create_and_get(); 654 $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) ); 655 clean_user_cache( $user ); 656 657 $user = get_userdata( $user->ID ); 658 $this->assertEquals( 'key', $user->user_activation_key ); 659 660 $userdata = array( 661 'ID' => $user->ID, 662 'user_pass' => 'password', 663 ); 664 wp_update_user( $userdata ); 665 666 $user = get_userdata( $user->ID ); 667 $this->assertEmpty( $user->user_activation_key ); 668 } 669 649 670 }
Note: See TracChangeset
for help on using the changeset viewer.