WordPress.org

Make WordPress Core

Ticket #17571: 17571_unit_test.patch

File 17571_unit_test.patch, 1.1 KB (added by kurtpayne, 4 years ago)

Unit test

  • wp-testcase/test_includes_formatting.php

     
    357357                $this->assertEquals($invalid_nest, wptexturize($invalid_nest)); 
    358358 
    359359        } 
     360         
     361        function test_escaped_quotes_17571() { 
     362                $this->knownWPBug(17571); 
     363                $this->assertEquals('“left half”', wptexturize('\"left half"')); 
     364                $this->assertEquals('“right half”', wptexturize('"right half\"')); 
     365                $this->assertEquals('“both”', wptexturize('\"both\"')); 
     366                $this->assertEquals('“neither”', wptexturize('"neither"')); 
     367                $this->assertEquals('“nested “both” quotes”', wptexturize('\"nested \"both\" quotes\"')); 
     368                $this->assertEquals("‘apostrophes, too’", wptexturize("'apostrophes, too'")); 
     369                $this->assertEquals("‘apostrophes and “escaped” quotes all together’", wptexturize("\'apostrophes and \"escaped\" quotes all together\'")); 
     370        } 
    360371 
    361372        //WP Ticket #1418 
    362373        function test_bracketed_quotes_1418() {