From 086d49daec98248a569dbfb4c6be9bea241c2762 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Tue, 6 Oct 2015 07:01:32 +0000 Subject: [PATCH] Users: Add a separate test for checking the validity of a username containing uppercase characters in the scope of single vs multisite. 'JohnDoe' in single site: valid 'JohnDoe' in multisite: invalid See #24618. git-svn-id: https://develop.svn.wordpress.org/trunk@34858 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/user.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/user.php b/tests/phpunit/tests/user.php index 7c022617e7..23dc291124 100644 --- a/tests/phpunit/tests/user.php +++ b/tests/phpunit/tests/user.php @@ -603,11 +603,21 @@ class Tests_User extends WP_UnitTestCase { * @ticket 24618 */ public function test_validate_username_string() { - $this->assertTrue( validate_username( rand_str() ) ); - $this->assertTrue( validate_username( 'JohnDoe' ) ); + $this->assertTrue( validate_username( 'johndoe' ) ); $this->assertTrue( validate_username( 'test@test.com' ) ); } + /** + * @ticket 24618 + */ + public function test_validate_username_contains_uppercase_letters() { + if ( is_multisite() ) { + $this->assertFalse( validate_username( 'JohnDoe' ) ); + } else { + $this->assertTue( validate_username( 'JohnDoe' ) ); + } + } + /** * @ticket 24618 */