Changeset 52010 for trunk/tests/phpunit/tests/formatting/wpSpecialchars.php
- Timestamp:
- 11/04/2021 03:22:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/wpSpecialchars.php
r51623 r52010 5 5 */ 6 6 class Tests_Formatting_wpSpecialchars extends WP_UnitTestCase { 7 function test_wp_specialchars_basics() {7 public function test_wp_specialchars_basics() { 8 8 $html = '&<hello world>'; 9 9 $this->assertSame( $html, _wp_specialchars( $html ) ); … … 13 13 } 14 14 15 function test_allowed_entity_names() {15 public function test_allowed_entity_names() { 16 16 global $allowedentitynames; 17 17 … … 27 27 } 28 28 29 function test_not_allowed_entity_names() {29 public function test_not_allowed_entity_names() { 30 30 $ents = array( 'iacut', 'aposs', 'pos', 'apo', 'apo?', 'apo.*', '.*apo.*', 'apos ', ' apos', ' apos ' ); 31 31 … … 37 37 } 38 38 39 function test_optionally_escapes_quotes() {39 public function test_optionally_escapes_quotes() { 40 40 $source = "\"'hello!'\""; 41 41 $this->assertSame( '"'hello!'"', _wp_specialchars( $source, 'single' ) ); … … 51 51 * @dataProvider data_double_encoding 52 52 */ 53 function test_double_encoding( $input, $output ) {53 public function test_double_encoding( $input, $output ) { 54 54 return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, true ) ); 55 55 } 56 56 57 function data_double_encoding() {57 public function data_double_encoding() { 58 58 return array( 59 59 array( … … 78 78 * @dataProvider data_no_double_encoding 79 79 */ 80 function test_no_double_encoding( $input, $output ) {80 public function test_no_double_encoding( $input, $output ) { 81 81 return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, false ) ); 82 82 } 83 83 84 function data_no_double_encoding() {84 public function data_no_double_encoding() { 85 85 return array( 86 86 array(
Note: See TracChangeset
for help on using the changeset viewer.