Make WordPress Core

Ticket #32335: 32335.2.patch

File 32335.2.patch, 2.8 KB (added by boonebgorges, 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 <?php
    2 
    3 /**
    4  * @group formatting
    5  */
    6 class Tests_Formatting_ConvertChars extends WP_UnitTestCase {
    7         function test_replaces_windows1252_entities_with_unicode_ones() {
    8                 $input = "&#130;&#131;&#132;&#133;&#134;&#135;&#136;&#137;&#138;&#139;&#140;&#145;&#146;&#147;&#148;&#149;&#150;&#151;&#152;&#153;&#154;&#155;&#156;&#159;";
    9                 $output = "&#8218;&#402;&#8222;&#8230;&#8224;&#8225;&#710;&#8240;&#352;&#8249;&#338;&#8216;&#8217;&#8220;&#8221;&#8226;&#8211;&#8212;&#732;&#8482;&#353;&#8250;&#339;&#376;";
    10                 $this->assertEquals($output, convert_chars($input));
    11         }
    12 
    13         /**
    14          * @ticket 20503
    15          */
    16         function test_replaces_latin_letter_z_with_caron() {
    17                 $input = "&#142;&#158;";
    18                 $output = "&#381;&#382;";
    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&#038;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 */
     6class Tests_Formatting_ConvertInvalidEntities extends WP_UnitTestCase {
     7        function test_replaces_windows1252_entities_with_unicode_ones() {
     8                $input = "&#130;&#131;&#132;&#133;&#134;&#135;&#136;&#137;&#138;&#139;&#140;&#145;&#146;&#147;&#148;&#149;&#150;&#151;&#152;&#153;&#154;&#155;&#156;&#159;";
     9                $output = "&#8218;&#402;&#8222;&#8230;&#8224;&#8225;&#710;&#8240;&#352;&#8249;&#338;&#8216;&#8217;&#8220;&#8221;&#8226;&#8211;&#8212;&#732;&#8482;&#353;&#8250;&#339;&#376;";
     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 = "&#142;&#158;";
     18                $output = "&#381;&#382;";
     19                $this->assertEquals( $output, convert_invalid_entities( $input ) );
     20        }
     21
     22        function test_escapes_lone_ampersands() {
     23                $this->assertEquals("at&#038;t", convert_chars("at&t"));
     24        }
     25}