Changes from branches/4.0/tests/phpunit/tests/user.php at r30431 to trunk/tests/phpunit/tests/user.php at r29341
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/user.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user.php
r30431 r29341 655 655 $this->assertNotContains( 'key', $metas ); 656 656 } 657 658 function test_changing_email_invalidates_password_reset_key() {659 global $wpdb;660 661 $user = $this->factory->user->create_and_get();662 $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) );663 clean_user_cache( $user );664 665 $user = get_userdata( $user->ID );666 $this->assertEquals( 'key', $user->user_activation_key );667 668 // Check that changing something other than the email doesn't remove the key.669 $userdata = array(670 'ID' => $user->ID,671 'user_nicename' => 'wat',672 );673 wp_update_user( $userdata );674 675 $user = get_userdata( $user->ID );676 $this->assertEquals( 'key', $user->user_activation_key );677 678 // Now check that changing the email does remove it.679 $userdata = array(680 'ID' => $user->ID,681 'user_nicename' => 'cat',682 'user_email' => 'foo@bar.dev',683 );684 wp_update_user( $userdata );685 686 $user = get_userdata( $user->ID );687 $this->assertEmpty( $user->user_activation_key );688 }689 657 }
Note: See TracChangeset
for help on using the changeset viewer.