Changeset 33148 for trunk/tests/phpunit/tests/formatting/WPSpecialchars.php
- Timestamp:
- 07/09/2015 08:55:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/WPSpecialchars.php
r32851 r33148 18 18 // Allowed entities should be unchanged 19 19 foreach ( $allowedentitynames as $ent ) { 20 if ( 'apos' == $ent ) {21 // But for some reason, PHP doesn't allow '22 continue;23 }24 20 $ent = '&' . $ent . ';'; 25 21 $this->assertEquals( $ent, _wp_specialchars( $ent ) ); … … 44 40 $this->assertEquals( $source, _wp_specialchars($source) ); 45 41 } 46 47 /**48 * Check some of the double-encoding features for entity references.49 *50 * @ticket 1778051 * @dataProvider data_double_encoding52 */53 function test_double_encoding( $input, $output ) {54 return $this->assertEquals( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, true ) );55 }56 57 function data_double_encoding() {58 return array(59 array(60 'This & that, this & that, — " " Ú " " " " " $ ×',61 'This & that, this & that, — " " Ú   " " " " " $ ×',62 ),63 array(64 '&& && && &;',65 '&& && && &;',66 ),67 array(68 '&garbage; &***; &aaaa; &0000; &####; &;;',69 '&garbage; &***; &aaaa; &0000; &####; &;;',70 ),71 );72 }73 74 /**75 * Check some of the double-encoding features for entity references.76 *77 * @ticket 1778078 * @dataProvider data_no_double_encoding79 */80 function test_no_double_encoding( $input, $output ) {81 return $this->assertEquals( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, false ) );82 }83 84 function data_no_double_encoding() {85 return array(86 array(87 'This & that, this & that, — " " Ú " " " " " $ ×',88 'This & that, this & that, — " " Ú " " " " " $ ×',89 ),90 array(91 '&& && && &;',92 '&& && && &;',93 ),94 array(95 '&garbage; &***; &aaaa; &0000; &####; &;;',96 '&garbage; &***; &aaaa; &0000; &####; &;;',97 ),98 );99 }100 42 }
Note: See TracChangeset
for help on using the changeset viewer.