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
This commit is contained in:
parent
536ba180df
commit
086d49daec
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user