Ticket #18549: 18549.3.diff
File 18549.3.diff, 6.6 KB (added by , 10 years ago) |
---|
-
tests/phpunit/tests/formatting/WPTexturize.php
81 81 */ 82 82 function test_quotes() { 83 83 $this->assertEquals('“Quoted String”', wptexturize('"Quoted String"')); 84 //$this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"'));85 //$this->assertEquals('Here is “<a href="http://example.com">a test with a link and a period</a>”.', wptexturize('Here is "<a href="http://example.com">a test with a link and a period</a>".'));86 84 $this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>” and a space.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>" and a space.')); 87 85 $this->assertEquals('Here is “<a href="http://example.com">a test with a link</a> and some text quoted”', wptexturize('Here is "<a href="http://example.com">a test with a link</a> and some text quoted"')); 88 //$this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”, and a comma.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>", and a comma.')); 89 //$this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”; and a semi-colon.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"; and a semi-colon.')); 90 //$this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”- and a dash.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"- and a dash.')); 91 //$this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”… and ellipses.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"... and ellipses.')); 92 //$this->assertEquals('Here is “a test <a href="http://example.com">with a link</a>”.', wptexturize('Here is "a test <a href="http://example.com">with a link</a>".')); 86 } 87 88 /** 89 * @ticket 18549 90 */ 91 function test_texturize_around_html() { 92 $this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"')); 93 $this->assertEquals('Here is “<a href="http://example.com">a test with a link and a period</a>”.', wptexturize('Here is "<a href="http://example.com">a test with a link and a period</a>".')); 94 $this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”, and a comma.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>", and a comma.')); 95 $this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”; and a semi-colon.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"; and a semi-colon.')); 96 $this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”- and a dash.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"- and a dash.')); 97 $this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”… and ellipses.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"... and ellipses.')); 98 $this->assertEquals('Here is “a test <a href="http://example.com">with a link</a>”.', wptexturize('Here is "a test <a href="http://example.com">with a link</a>".')); 93 99 //$this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”and a work stuck to the end.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"and a work stuck to the end.')); 94 //$this->assertEquals('A test with a finishing number, “like 23”.', wptexturize('A test with a finishing number, "like 23".'));95 //$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.'));100 $this->assertEquals('‘<strong>Quoted Text</strong>’,', wptexturize("'<strong>Quoted Text</strong>',")); 101 $this->assertEquals('“<strong>Quoted Text</strong>”,', wptexturize('"<strong>Quoted Text</strong>",')); 96 102 } 97 103 98 104 /** … … 115 121 $this->assertEquals('‘Class of ’99’', wptexturize("'Class of '99'")); 116 122 $this->assertEquals('‘Class of ’99’s’', wptexturize("'Class of '99's'")); 117 123 $this->assertEquals('‘Class of ’99’s’', wptexturize("'Class of '99’s'")); 118 //$this->assertEquals('“Class of 99”', wptexturize("\"Class of 99\""));119 124 $this->assertEquals('“Class of ’99”', wptexturize("\"Class of '99\"")); 120 125 $this->assertEquals('{“Class of ’99”}', wptexturize("{\"Class of '99\"}")); 121 126 $this->assertEquals(' “Class of ’99” ', wptexturize(" \"Class of '99\" ")); … … 122 127 $this->assertEquals('}”Class of ’99″{', wptexturize("}\"Class of '99\"{")); // Not a quotation, may be between two other quotations. 123 128 } 124 129 130 /** 131 * @ticket 29256 132 */ 125 133 function test_quotes_after_numbers() { 126 134 $this->assertEquals('Class of ’99', wptexturize("Class of '99")); 135 $this->assertEquals('A test with a finishing number, “like 23”.', wptexturize('A test with a finishing number, "like 23".')); 136 $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.')); 137 $this->assertEquals('“Class of 99”', wptexturize("\"Class of 99\"")); 127 138 } 128 139 129 140 /** … … 132 143 */ 133 144 function test_other_html() { 134 145 $this->assertEquals('‘<strong>', wptexturize("'<strong>")); 135 //$this->assertEquals('‘<strong>Quoted Text</strong>’,', wptexturize("'<strong>Quoted Text</strong>',"));136 //$this->assertEquals('“<strong>Quoted Text</strong>”,', wptexturize('"<strong>Quoted Text</strong>",'));137 146 } 138 147 139 148 function test_x() { … … 173 182 /** 174 183 * @ticket 4539 175 184 * @ticket 15241 185 * @ticket 20342 186 * @ticket 22692 176 187 */ 177 188 function test_entity_quote_cuddling() { 178 189 $this->assertEquals(' “Testing”', wptexturize(' "Testing"')); 179 //$this->assertEquals('&“Testing”', wptexturize('&"Testing"'));190 $this->assertEquals('&“Testing”', wptexturize('&"Testing"')); 180 191 } 181 192 182 193 /**