Add unit test verifying that 60 char user_login is valid.

Props ruudjoyo.
Fixes #33793.

git-svn-id: https://develop.svn.wordpress.org/trunk@34626 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2015-09-27 15:41:11 +00:00
parent de0b5c846f
commit 8dc7bd8091

View File

@ -614,6 +614,25 @@ class Tests_User extends WP_UnitTestCase {
$this->assertSame( $user->user_nicename, $updated_user->user_nicename );
}
/**
* @ticket 33793
*/
public function test_wp_insert_user_should_accept_user_login_with_60_characters() {
$user_login = str_repeat( 'a', 60 );
$u = wp_insert_user( array(
'user_login' => $user_login,
'user_email' => $user_login . '@example.com',
'user_pass' => 'password',
'user_nicename' => 'something-short',
) );
$this->assertInternalType( 'int', $u );
$this->assertGreaterThan( 0, $u );
$user = new WP_User( $u );
$this->assertSame( $user_login, $user->user_login );
}
/**
* @ticket 33793
*/