Make WordPress Core

Changeset 32947


Ignore:
Timestamp:
06/25/2015 07:50:14 PM (8 years ago)
Author:
wonderboymusic
Message:

After [32896], update ConvertChars.php unit tests and rename to ConvertInvalidEntries.php.

Props boonebgorges.
Fixes #32335.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/ConvertInvalidEntries.php

    r32946 r32947  
    44 * @group formatting
    55 */
    6 class Tests_Formatting_ConvertChars extends WP_UnitTestCase {
     6class Tests_Formatting_ConvertInvalidEntities extends WP_UnitTestCase {
    77    function test_replaces_windows1252_entities_with_unicode_ones() {
    88        $input = "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ";
    99        $output = "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ";
    10         $this->assertEquals($output, convert_chars($input));
     10        $this->assertEquals( $output, convert_invalid_entities( $input ) );
    1111    }
    1212
     
    1717        $input = "Žž";
    1818        $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         }
     19        $this->assertEquals( $output, convert_invalid_entities( $input ) );
    3120    }
    3221
     
    3423        $this->assertEquals("at&#038;t", convert_chars("at&t"));
    3524    }
    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     }
    4025}
Note: See TracChangeset for help on using the changeset viewer.