Changeset 48937 for trunk/tests/phpunit/tests/formatting/WPSpecialchars.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/WPSpecialchars.php
r47122 r48937 7 7 function test_wp_specialchars_basics() { 8 8 $html = '&<hello world>'; 9 $this->assert Equals( $html, _wp_specialchars( $html ) );9 $this->assertSame( $html, _wp_specialchars( $html ) ); 10 10 11 11 $double = '&amp;&lt;hello world&gt;'; 12 $this->assert Equals( $double, _wp_specialchars( $html, ENT_NOQUOTES, false, true ) );12 $this->assertSame( $double, _wp_specialchars( $html, ENT_NOQUOTES, false, true ) ); 13 13 } 14 14 … … 23 23 } 24 24 $ent = '&' . $ent . ';'; 25 $this->assert Equals( $ent, _wp_specialchars( $ent ) );25 $this->assertSame( $ent, _wp_specialchars( $ent ) ); 26 26 } 27 27 } … … 33 33 $escaped = '&' . $ent . ';'; 34 34 $ent = '&' . $ent . ';'; 35 $this->assert Equals( $escaped, _wp_specialchars( $ent ) );35 $this->assertSame( $escaped, _wp_specialchars( $ent ) ); 36 36 } 37 37 } … … 39 39 function test_optionally_escapes_quotes() { 40 40 $source = "\"'hello!'\""; 41 $this->assert Equals( '"'hello!'"', _wp_specialchars( $source, 'single' ) );42 $this->assert Equals( ""'hello!'"", _wp_specialchars( $source, 'double' ) );43 $this->assert Equals( '"'hello!'"', _wp_specialchars( $source, true ) );44 $this->assert Equals( $source, _wp_specialchars( $source ) );41 $this->assertSame( '"'hello!'"', _wp_specialchars( $source, 'single' ) ); 42 $this->assertSame( ""'hello!'"", _wp_specialchars( $source, 'double' ) ); 43 $this->assertSame( '"'hello!'"', _wp_specialchars( $source, true ) ); 44 $this->assertSame( $source, _wp_specialchars( $source ) ); 45 45 } 46 46 … … 52 52 */ 53 53 function test_double_encoding( $input, $output ) { 54 return $this->assert Equals( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, true ) );54 return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, true ) ); 55 55 } 56 56 … … 79 79 */ 80 80 function test_no_double_encoding( $input, $output ) { 81 return $this->assert Equals( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, false ) );81 return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, false ) ); 82 82 } 83 83
Note: See TracChangeset
for help on using the changeset viewer.