WordPress.org

Make WordPress Core

Ticket #4539: 4539_2_test_cases_fixed_1_left.diff

File 4539_2_test_cases_fixed_1_left.diff, 2.4 KB (added by norbertm, 9 years ago)
  • wordpress/wp-includes/formatting.php

     
    5656                $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'\'', ' (tm)'), $cockney);
    5757                $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, $closing_quote, ' ™'), $cockneyreplace);
    5858
    59                 $dynamic_characters = array('/\'(\d\d(?:&#8217;|\')?s)/', '/\'(\d)/', '/(\s|\A|[([{<]|")\'/', '/(\d)"/', '/(\d)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/\b(\d+)x(\d+)\b/');
    60                 $dynamic_replacements = array('&#8217;$1','&#8217;$1', '$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '&#8217;$1', '$1&#215;$2');
     59                $dynamic_characters = array('/\'(\d)/', '/\'(\d\d(?:&#8217;|\')?s)/', '/(\s|\A|[([{<]|")\'/', '/(\S)\'([^\'\s])/', '/\'([\s.]|\Z)/', '/(\d)"/', '/(\d)\'/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\b(\d+)x(\d+)\b/');
     60                $dynamic_replacements = array('&#8217;$1', '&#8217;$1', '$1&#8216;', '$1&#8217;$2', '&#8217;$1', '$1&#8243;', '$1&#8242;', '$1' . $opening_quote . '$2', $closing_quote . '$1', '$1&#215;$2');
    6161
    6262                $static_setup = true;
    6363        }
  • wp-testcase/test_includes_formatting.php

     
    403403                $this->assertEquals('A test with a number, &#8220;like 62&#8221;, is nice to have.', wptexturize('A test with a number, "like 62", is nice to have.'));
    404404        }
    405405       
    406         //WP Ticket #1258
     406        //WP Ticket #4539
    407407        function test_quotes_before_s() {
    408                 $this->knownWPBug(4539);
    409408                $this->assertEquals('test&#8217;s', wptexturize("test's"));
    410409                $this->assertEquals('&#8216;test&#8217;s', wptexturize("'test's"));
    411410                $this->assertEquals('&#8216;test&#8217;s&#8217;', wptexturize("'test's'"));
     
    415414
    416415        //WP Ticket #4539
    417416        function test_quotes_before_numbers() {
    418                 $this->knownWPBug(4539);
    419417                $this->assertEquals('Class of &#8217;99', wptexturize("Class of '99"));
    420418                $this->assertEquals('&#8216;Class of &#8217;99&#8217;', wptexturize("'Class of '99'"));
    421419        }