Ensure sanitize_user() expected test values are lowercase on multisite.

[30524] neglected to account for the fact that multisite forces user logins to
lowercase.

See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30527 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2014-11-22 21:29:40 +00:00
parent 96f9d84dba
commit 4992fdb95f

View File

@ -11,11 +11,25 @@ class Tests_Formatting_SanitizeUser extends WP_UnitTestCase {
} }
public function test_strips_encoded_ampersand() { public function test_strips_encoded_ampersand() {
$this->assertEquals("ATT", sanitize_user("AT&T")); $expected = 'ATT';
// Multisite forces user logins to lowercase.
if ( is_multisite() ) {
$expected = strtolower( $expected );
}
$this->assertEquals( $expected, sanitize_user( "AT&T" ) );
} }
public function test_strips_encoded_ampersand_when_followed_by_semicolon() { public function test_strips_encoded_ampersand_when_followed_by_semicolon() {
$this->assertEquals("ATT Test;", sanitize_user("AT&T Test;")); $expected = 'ATT Test;';
// Multisite forces user logins to lowercase.
if ( is_multisite() ) {
$expected = strtolower( $expected );
}
$this->assertEquals( $expected, sanitize_user( "AT&T Test;" ) );
} }
function test_strips_percent_encoded_octets() { function test_strips_percent_encoded_octets() {