Ticket #32335: 32335.2.patch
File 32335.2.patch, 2.8 KB (added by , 8 years ago) |
---|
-
deleted file tests/phpunit/tests/formatting/ConvertChars.php
diff --git a/tests/phpunit/tests/formatting/ConvertChars.php b/tests/phpunit/tests/formatting/ConvertChars.php deleted file mode 100644 index a134572..0000000
+ - 1 <?php2 3 /**4 * @group formatting5 */6 class Tests_Formatting_ConvertChars extends WP_UnitTestCase {7 function test_replaces_windows1252_entities_with_unicode_ones() {8 $input = "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ";9 $output = "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ";10 $this->assertEquals($output, convert_chars($input));11 }12 13 /**14 * @ticket 2050315 */16 function test_replaces_latin_letter_z_with_caron() {17 $input = "Žž";18 $output = "Žž";19 $this->assertEquals( $output, convert_chars( $input ) );20 }21 22 function test_converts_html_br_and_hr_to_the_xhtml_self_closing_variety() {23 $inputs = array(24 "abc <br> lol <br />" => "abc <br /> lol <br />",25 "<br> ho ho <hr>" => "<br /> ho ho <hr />",26 "<hr><br>" => "<hr /><br />"27 );28 foreach ($inputs as $input => $expected) {29 $this->assertEquals($expected, convert_chars($input));30 }31 }32 33 function test_escapes_lone_ampersands() {34 $this->assertEquals("at&t", convert_chars("at&t"));35 }36 37 function test_removes_category_and_title_metadata_tags() {38 $this->assertEquals("", convert_chars("<title><div class='lol'>abc</div></title><category>a</category>"));39 }40 } -
new file tests/phpunit/tests/formatting/ConvertInvalidEntries.php
diff --git a/tests/phpunit/tests/formatting/ConvertInvalidEntries.php b/tests/phpunit/tests/formatting/ConvertInvalidEntries.php new file mode 100644 index 0000000..0bf2437
- + 1 <?php 2 3 /** 4 * @group formatting 5 */ 6 class Tests_Formatting_ConvertInvalidEntities extends WP_UnitTestCase { 7 function test_replaces_windows1252_entities_with_unicode_ones() { 8 $input = "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ"; 9 $output = "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ"; 10 $this->assertEquals( $output, convert_invalid_entities( $input ) ); 11 } 12 13 /** 14 * @ticket 20503 15 */ 16 function test_replaces_latin_letter_z_with_caron() { 17 $input = "Žž"; 18 $output = "Žž"; 19 $this->assertEquals( $output, convert_invalid_entities( $input ) ); 20 } 21 22 function test_escapes_lone_ampersands() { 23 $this->assertEquals("at&t", convert_chars("at&t")); 24 } 25 }