assertEquals('Hey — boo?', wptexturize('Hey -- boo?')); $this->assertEquals('Hey — boo?', wptexturize('Hey -- boo?')); } function test_disable() { $this->assertEquals('
---', wptexturize('
---')); $this->assertEquals('[a]a–b[code]---[/code]a–b[/a]', wptexturize('[a]a--b[code]---[/code]a--b[/a]')); $this->assertEquals('
--', wptexturize('--'));
$this->assertEquals('---', wptexturize('---'));
$this->assertEquals('href="baba" “baba”', wptexturize('href="baba" "baba"'));
$enabled_tags_inside_code = 'curl -s baba | grep sfive | cut -d "\"" -f 10 > topmp3.txt';
$this->assertEquals($enabled_tags_inside_code, wptexturize($enabled_tags_inside_code));
$double_nest = '"baba""baba""baba"';
$this->assertEquals($double_nest, wptexturize($double_nest));
$invalid_nest = '"baba"'; $this->assertEquals($invalid_nest, wptexturize($invalid_nest)); } //WP Ticket #1418 function test_bracketed_quotes_1418() { $this->assertEquals('(“test”)', wptexturize('("test")')); $this->assertEquals('(‘test’)', wptexturize("('test')")); $this->assertEquals('(’twas)', wptexturize("('twas)")); } //WP Ticket #3810 function test_bracketed_quotes_3810() { $this->assertEquals('A dog (“Hubertus”) was sent out.', wptexturize('A dog ("Hubertus") was sent out.')); } //WP Ticket #4539 function test_basic_quotes() { $this->assertEquals('test’s', wptexturize('test\'s')); $this->assertEquals('test’s', wptexturize('test\'s')); $this->assertEquals('‘quoted’', wptexturize('\'quoted\'')); $this->assertEquals('“quoted”', wptexturize('"quoted"')); $this->assertEquals('space before ‘quoted’ space after', wptexturize('space before \'quoted\' space after')); $this->assertEquals('space before “quoted” space after', wptexturize('space before "quoted" space after')); $this->assertEquals('(‘quoted’)', wptexturize('(\'quoted\')')); $this->assertEquals('{“quoted”}', wptexturize('{"quoted"}')); $this->assertEquals('‘qu(ot)ed’', wptexturize('\'qu(ot)ed\'')); $this->assertEquals('“qu{ot}ed”', wptexturize('"qu{ot}ed"')); $this->assertEquals(' ‘test’s quoted’ ', wptexturize(' \'test\'s quoted\' ')); $this->assertEquals(' “test’s quoted” ', wptexturize(' "test\'s quoted" ')); } /** * @ticket 4539 * @ticket 15241 */ function test_full_sentences_with_unmatched_single_quotes() { $this->assertEquals( 'That means every moment you’re working on something without it being in the public it’s actually dying.', wptexturize("That means every moment you're working on something without it being in the public it's actually dying.") ); } /** * @ticket 4539 */ function test_quotes() { $this->assertEquals('“Quoted String”', wptexturize('"Quoted String"')); $this->assertEquals('Here is “a test with a link”', wptexturize('Here is "a test with a link"')); $this->assertEquals('Here is “a test with a link and a period”.', wptexturize('Here is "a test with a link and a period".')); $this->assertEquals('Here is “a test with a link” and a space.', wptexturize('Here is "a test with a link" and a space.')); $this->assertEquals('Here is “a test with a link and some text quoted”', wptexturize('Here is "a test with a link and some text quoted"')); $this->assertEquals('Here is “a test with a link”, and a comma.', wptexturize('Here is "a test with a link", and a comma.')); $this->assertEquals('Here is “a test with a link”; and a semi-colon.', wptexturize('Here is "a test with a link"; and a semi-colon.')); $this->assertEquals('Here is “a test with a link”- and a dash.', wptexturize('Here is "a test with a link"- and a dash.')); $this->assertEquals('Here is “a test with a link”… and ellipses.', wptexturize('Here is "a test with a link"... and ellipses.')); $this->assertEquals('Here is “a test with a link”.', wptexturize('Here is "a test with a link".')); $this->assertEquals('Here is “a test with a link”and a work stuck to the end.', wptexturize('Here is "a test with a link"and a work stuck to the end.')); $this->assertEquals('A test with a finishing number, “like 23”.', wptexturize('A test with a finishing number, "like 23".')); $this->assertEquals('A test with a number, “like 62”, is nice to have.', wptexturize('A test with a number, "like 62", is nice to have.')); } /** * @ticket 4539 */ function test_quotes_before_s() { $this->assertEquals('test’s', wptexturize("test's")); $this->assertEquals('‘test’s', wptexturize("'test's")); $this->assertEquals('‘test’s’', wptexturize("'test's'")); $this->assertEquals('‘string’', wptexturize("'string'")); $this->assertEquals('‘string’s’', wptexturize("'string's'")); } /** * @ticket 4539 */ function test_quotes_before_numbers() { $this->assertEquals('Class of ’99', wptexturize("Class of '99")); $this->assertEquals('Class of ’99’s', wptexturize("Class of '99's")); $this->assertEquals('‘Class of ’99’', wptexturize("'Class of '99'")); $this->assertEquals('‘Class of ’99’s’', wptexturize("'Class of '99's'")); $this->assertEquals('‘Class of ’99’s’', wptexturize("'Class of '99’s'")); $this->assertEquals('“Class of 99”', wptexturize("\"Class of 99\"")); $this->assertEquals('“Class of ’99”', wptexturize("\"Class of '99\"")); } function test_quotes_after_numbers() { $this->assertEquals('Class of ’99', wptexturize("Class of '99")); } /** * @ticket 4539 * @ticket 15241 */ function test_other_html() { $this->assertEquals('‘', wptexturize("'")); $this->assertEquals('‘Quoted Text’,', wptexturize("'Quoted Text',")); $this->assertEquals('“Quoted Text”,', wptexturize('"Quoted Text",')); } function test_x() { $this->assertEquals('14×24', wptexturize("14x24")); } function test_minutes_seconds() { $this->assertEquals('9′', wptexturize('9\'')); $this->assertEquals('9″', wptexturize("9\"")); $this->assertEquals('a 9′ b', wptexturize('a 9\' b')); $this->assertEquals('a 9″ b', wptexturize("a 9\" b")); $this->assertEquals('“a 9′ b”', wptexturize('"a 9\' b"')); $this->assertEquals('‘a 9″ b’', wptexturize("'a 9\" b'")); } /** * @ticket 8775 */ function test_wptexturize_quotes_around_numbers() { $this->assertEquals('“12345”', wptexturize('"12345"')); $this->assertEquals('‘12345’', wptexturize('\'12345\'')); $this->assertEquals('“a 9′ plus a ‘9’, maybe a 9′ ‘9’ ”', wptexturize('"a 9\' plus a \'9\', maybe a 9\' \'9\' "')); $this->assertEquals('
‘99
‘123’
’tis
‘s’
\'99
\'123\'
\'tis
\'s\'