WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/06/2015 07:01:32 AM (5 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user.php

    r34856 r34858  
    604604     */
    605605    public function test_validate_username_string() {
    606         $this->assertTrue( validate_username( rand_str() ) );
    607         $this->assertTrue( validate_username( 'JohnDoe' ) );
     606        $this->assertTrue( validate_username( 'johndoe' ) );
    608607        $this->assertTrue( validate_username( 'test@test.com' ) );
     608    }
     609
     610    /**
     611     * @ticket 24618
     612     */
     613    public function test_validate_username_contains_uppercase_letters() {
     614        if ( is_multisite() ) {
     615            $this->assertFalse( validate_username( 'JohnDoe' ) );
     616        } else {
     617            $this->assertTue( validate_username( 'JohnDoe' ) );
     618        }
    609619    }
    610620
Note: See TracChangeset for help on using the changeset viewer.