WordPress.org

Make WordPress Core

Changeset 30527


Ignore:
Timestamp:
11/22/2014 09:29:40 PM (6 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/SanitizeUser.php

    r30515 r30527  
    1212
    1313    public function test_strips_encoded_ampersand() {
    14         $this->assertEquals("ATT", sanitize_user("AT&T"));
     14        $expected = 'ATT';
     15
     16        // Multisite forces user logins to lowercase.
     17        if ( is_multisite() ) {
     18            $expected = strtolower( $expected );
     19        }
     20
     21        $this->assertEquals( $expected, sanitize_user( "AT&T" ) );
    1522    }
    1623
    1724    public function test_strips_encoded_ampersand_when_followed_by_semicolon() {
    18         $this->assertEquals("ATT Test;", sanitize_user("AT&T Test;"));
     25        $expected = 'ATT Test;';
     26
     27        // Multisite forces user logins to lowercase.
     28        if ( is_multisite() ) {
     29            $expected = strtolower( $expected );
     30        }
     31
     32        $this->assertEquals( $expected, sanitize_user( "AT&T Test;" ) );
    1933    }
    2034
Note: See TracChangeset for help on using the changeset viewer.