Changeset 42343 for trunk/tests/phpunit/tests/formatting/SanitizeUser.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/SanitizeUser.php
r30527 r42343 6 6 class Tests_Formatting_SanitizeUser extends WP_UnitTestCase { 7 7 function test_strips_html() { 8 $input = "Captain <strong>Awesome</strong>";8 $input = 'Captain <strong>Awesome</strong>'; 9 9 $expected = is_multisite() ? 'captain awesome' : 'Captain Awesome'; 10 $this->assertEquals( $expected, sanitize_user($input));10 $this->assertEquals( $expected, sanitize_user( $input ) ); 11 11 } 12 12 … … 19 19 } 20 20 21 $this->assertEquals( $expected, sanitize_user( "AT&T") );21 $this->assertEquals( $expected, sanitize_user( 'AT&T' ) ); 22 22 } 23 23 … … 30 30 } 31 31 32 $this->assertEquals( $expected, sanitize_user( "AT&T Test;") );32 $this->assertEquals( $expected, sanitize_user( 'AT&T Test;' ) ); 33 33 } 34 34 35 35 function test_strips_percent_encoded_octets() { 36 36 $expected = is_multisite() ? 'franois' : 'Franois'; 37 $this->assertEquals( $expected, sanitize_user( "Fran%c3%a7ois") );37 $this->assertEquals( $expected, sanitize_user( 'Fran%c3%a7ois' ) ); 38 38 } 39 39 function test_optional_strict_mode_reduces_to_safe_ascii_subset() { 40 $this->assertEquals( "abc", sanitize_user("()~ab~ˆcˆ!", true));40 $this->assertEquals( 'abc', sanitize_user( '()~ab~ˆcˆ!', true ) ); 41 41 } 42 42 }
Note: See TracChangeset
for help on using the changeset viewer.