WordPress.org

Make WordPress Core

Changeset 757 in tests


Ignore:
Timestamp:
06/30/2012 03:12:54 PM (7 years ago)
Author:
nacin
Message:

Unit tests coverage for #WP8912, #WP8775, others. props jakub.tyrcha, fixes #20.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-testcase/test_includes_formatting.php

    r727 r757  
    560560        $this->assertEquals('“a 9′ b”', wptexturize('"a 9\' b"'));
    561561        $this->assertEquals('‘a 9″ b’', wptexturize("'a 9\" b'"));
     562    }
     563
     564    function test_wptexturize_quotes_around_numbers() {
     565        $this->knownWPBug(8775);
     566        $this->assertEquals('“12345”', wptexturize('"12345"'));
     567        $this->assertEquals('‘12345’', wptexturize('\'12345\''));
     568        $this->assertEquals('“a 9′ plus a ‘9’, maybe a 9′ ‘9’ ”', wptexturize('"a 9\' plus a \'9\', maybe a 9\' \'9\' "'));
     569        $this->assertEquals('<p>&#8216;99<br />&#8216;123&#8217;<br />&#8217;tis<br />&#8216;s&#8217;</p>', wptexturize('<p>\'99<br />\'123\'<br />\'tis<br />\'s\'</p>'));
     570    }
     571
     572    function test_wptexturize_html_comments() {
     573        $this->knownWPBug(8912);
     574        $this->assertEquals('<!--[if !IE]>--><!--<![endif]-->', wptexturize('<!--[if !IE]>--><!--<![endif]-->'));
     575        $this->assertEquals('<!--[if !IE]>"a 9\' plus a \'9\', maybe a 9\' \'9\' "<![endif]-->', wptexturize('<!--[if !IE]>"a 9\' plus a \'9\', maybe a 9\' \'9\' "<![endif]-->'));
     576        $this->assertEquals('<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>', wptexturize('<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>'));
    562577    }
    563578
     
    14561471}
    14571472
     1473
    14581474?>
Note: See TracChangeset for help on using the changeset viewer.