From 8dc7bd80915d3c090f1ebff888566e7cf8b450ab Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Sun, 27 Sep 2015 15:41:11 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/user.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/phpunit/tests/user.php b/tests/phpunit/tests/user.php index 56db120884..db4006acfd 100644 --- a/tests/phpunit/tests/user.php +++ b/tests/phpunit/tests/user.php @@ -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 */