mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Users: when calling wp_insert_user() with an valid user ID, return WP_Error instead of arbitrarily updating user meta.
Adds unit test. Props swissspidy, bilalcoder. Fixes #28004. git-svn-id: https://develop.svn.wordpress.org/trunk@35280 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -819,6 +819,20 @@ class Tests_User extends WP_UnitTestCase {
|
||||
$this->assertSame( $expected, $user->user_nicename );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 28004
|
||||
*/
|
||||
public function test_wp_insert_user_with_invalid_user_id() {
|
||||
$u = wp_insert_user( array(
|
||||
'ID' => 123,
|
||||
'user_login' => 'whatever',
|
||||
'user_email' => 'whatever@example.com',
|
||||
'user_pass' => 'password',
|
||||
) );
|
||||
|
||||
$this->assertWPError( $u );
|
||||
}
|
||||
|
||||
function test_changing_email_invalidates_password_reset_key() {
|
||||
global $wpdb;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user