Changeset 55360 for trunk/tests/phpunit/tests/user.php
- Timestamp:
- 02/17/2023 10:13:36 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user.php
r55358 r55360 899 899 900 900 /** 901 * @ticket 57394 902 */ 903 public function test_wp_insert_user_should_reject_user_login_that_matches_existing_user_email() { 904 $existing_email = get_option( 'admin_email' ); 905 $user_id = wp_insert_user( 906 array( 907 'user_login' => $existing_email, 908 'user_email' => 'whatever@example.com', 909 'user_pass' => 'whatever', 910 'user_nicename' => 'whatever', 911 ) 912 ); 913 914 $this->assertWPError( $user_id ); 915 $this->assertSame( 'existing_user_email_as_login', $user_id->get_error_code() ); 916 } 917 918 /** 901 919 * @ticket 33793 902 920 */ … … 933 951 $expected = str_repeat( 'a', 50 ); 934 952 $this->assertSame( $expected, $user->user_nicename ); 935 }936 937 /**938 * @ticket 57394939 */940 public function test_wp_insert_user_should_reject_username_that_matches_existing_user_email() {941 $existing_email = get_option( 'admin_email' );942 $username = wp_insert_user(943 array(944 'user_login' => $existing_email,945 'user_email' => 'whatever@example.com',946 'user_pass' => 'whatever',947 'user_nicename' => 'whatever',948 )949 );950 951 $this->assertWPError( $username );952 $this->assertSame( 'existing_user_login_as_email', $username->get_error_code() );953 953 } 954 954
Note: See TracChangeset
for help on using the changeset viewer.