Changeset 48937 for trunk/tests/phpunit/tests/formatting/WPTexturize.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/WPTexturize.php
r47198 r48937 6 6 class Tests_Formatting_WPTexturize extends WP_UnitTestCase { 7 7 function test_dashes() { 8 $this->assert Equals( 'Hey — boo?', wptexturize( 'Hey -- boo?' ) );9 $this->assert Equals( '<a href="http://xx--xx">Hey — boo?</a>', wptexturize( '<a href="http://xx--xx">Hey -- boo?</a>' ) );8 $this->assertSame( 'Hey — boo?', wptexturize( 'Hey -- boo?' ) ); 9 $this->assertSame( '<a href="http://xx--xx">Hey — boo?</a>', wptexturize( '<a href="http://xx--xx">Hey -- boo?</a>' ) ); 10 10 } 11 11 12 12 function test_disable() { 13 $this->assert Equals( '<pre>---&</pre>', wptexturize( '<pre>---&</pre>' ) );14 $this->assert Equals( '<pre><code></code>--&</pre>', wptexturize( '<pre><code></code>--&</pre>' ) );15 16 $this->assert Equals( '<code>---&</code>', wptexturize( '<code>---&</code>' ) );17 $this->assert Equals( '<kbd>---&</kbd>', wptexturize( '<kbd>---&</kbd>' ) );18 $this->assert Equals( '<style>---&</style>', wptexturize( '<style>---&</style>' ) );19 $this->assert Equals( '<script>---&</script>', wptexturize( '<script>---&</script>' ) );20 $this->assert Equals( '<tt>---&</tt>', wptexturize( '<tt>---&</tt>' ) );21 22 $this->assert Equals( '<code>href="baba"</code> “baba”', wptexturize( '<code>href="baba"</code> "baba"' ) );13 $this->assertSame( '<pre>---&</pre>', wptexturize( '<pre>---&</pre>' ) ); 14 $this->assertSame( '<pre><code></code>--&</pre>', wptexturize( '<pre><code></code>--&</pre>' ) ); 15 16 $this->assertSame( '<code>---&</code>', wptexturize( '<code>---&</code>' ) ); 17 $this->assertSame( '<kbd>---&</kbd>', wptexturize( '<kbd>---&</kbd>' ) ); 18 $this->assertSame( '<style>---&</style>', wptexturize( '<style>---&</style>' ) ); 19 $this->assertSame( '<script>---&</script>', wptexturize( '<script>---&</script>' ) ); 20 $this->assertSame( '<tt>---&</tt>', wptexturize( '<tt>---&</tt>' ) ); 21 22 $this->assertSame( '<code>href="baba"</code> “baba”', wptexturize( '<code>href="baba"</code> "baba"' ) ); 23 23 24 24 $enabled_tags_inside_code = '<code>curl -s <a href="http://x/">baba</a> | grep sfive | cut -d "\"" -f 10 > topmp3.txt</code>'; 25 $this->assert Equals( $enabled_tags_inside_code, wptexturize( $enabled_tags_inside_code ) );25 $this->assertSame( $enabled_tags_inside_code, wptexturize( $enabled_tags_inside_code ) ); 26 26 27 27 $double_nest = '<pre>"baba"<code>"baba"<pre></pre></code>"baba"</pre>'; 28 $this->assert Equals( $double_nest, wptexturize( $double_nest ) );28 $this->assertSame( $double_nest, wptexturize( $double_nest ) ); 29 29 30 30 $invalid_nest = '<pre></code>"baba"</pre>'; 31 $this->assert Equals( $invalid_nest, wptexturize( $invalid_nest ) );31 $this->assertSame( $invalid_nest, wptexturize( $invalid_nest ) ); 32 32 33 33 } … … 37 37 */ 38 38 function test_bracketed_quotes_1418() { 39 $this->assert Equals( '(“test”)', wptexturize( '("test")' ) );40 $this->assert Equals( '(‘test’)', wptexturize( "('test')" ) );41 $this->assert Equals( '(’twas)', wptexturize( "('twas)" ) );39 $this->assertSame( '(“test”)', wptexturize( '("test")' ) ); 40 $this->assertSame( '(‘test’)', wptexturize( "('test')" ) ); 41 $this->assertSame( '(’twas)', wptexturize( "('twas)" ) ); 42 42 } 43 43 … … 46 46 */ 47 47 function test_bracketed_quotes_3810() { 48 $this->assert Equals( 'A dog (“Hubertus”) was sent out.', wptexturize( 'A dog ("Hubertus") was sent out.' ) );48 $this->assertSame( 'A dog (“Hubertus”) was sent out.', wptexturize( 'A dog ("Hubertus") was sent out.' ) ); 49 49 } 50 50 … … 53 53 */ 54 54 function test_basic_quotes() { 55 $this->assert Equals( 'test’s', wptexturize( 'test\'s' ) );56 57 $this->assert Equals( '‘quoted’', wptexturize( '\'quoted\'' ) );58 $this->assert Equals( '“quoted”', wptexturize( '"quoted"' ) );59 60 $this->assert Equals( 'space before ‘quoted’ space after', wptexturize( 'space before \'quoted\' space after' ) );61 $this->assert Equals( 'space before “quoted” space after', wptexturize( 'space before "quoted" space after' ) );62 63 $this->assert Equals( '(‘quoted’)', wptexturize( '(\'quoted\')' ) );64 $this->assert Equals( '{“quoted”}', wptexturize( '{"quoted"}' ) );65 66 $this->assert Equals( '‘qu(ot)ed’', wptexturize( '\'qu(ot)ed\'' ) );67 $this->assert Equals( '“qu{ot}ed”', wptexturize( '"qu{ot}ed"' ) );68 69 $this->assert Equals( ' ‘test’s quoted’ ', wptexturize( ' \'test\'s quoted\' ' ) );70 $this->assert Equals( ' “test’s quoted” ', wptexturize( ' "test\'s quoted" ' ) );55 $this->assertSame( 'test’s', wptexturize( 'test\'s' ) ); 56 57 $this->assertSame( '‘quoted’', wptexturize( '\'quoted\'' ) ); 58 $this->assertSame( '“quoted”', wptexturize( '"quoted"' ) ); 59 60 $this->assertSame( 'space before ‘quoted’ space after', wptexturize( 'space before \'quoted\' space after' ) ); 61 $this->assertSame( 'space before “quoted” space after', wptexturize( 'space before "quoted" space after' ) ); 62 63 $this->assertSame( '(‘quoted’)', wptexturize( '(\'quoted\')' ) ); 64 $this->assertSame( '{“quoted”}', wptexturize( '{"quoted"}' ) ); 65 66 $this->assertSame( '‘qu(ot)ed’', wptexturize( '\'qu(ot)ed\'' ) ); 67 $this->assertSame( '“qu{ot}ed”', wptexturize( '"qu{ot}ed"' ) ); 68 69 $this->assertSame( ' ‘test’s quoted’ ', wptexturize( ' \'test\'s quoted\' ' ) ); 70 $this->assertSame( ' “test’s quoted” ', wptexturize( ' "test\'s quoted" ' ) ); 71 71 } 72 72 … … 76 76 */ 77 77 function test_full_sentences_with_unmatched_single_quotes() { 78 $this->assert Equals(78 $this->assertSame( 79 79 'That means every moment you’re working on something without it being in the public it’s actually dying.', 80 80 wptexturize( "That means every moment you're working on something without it being in the public it's actually dying." ) … … 86 86 */ 87 87 function test_quotes() { 88 $this->assert Equals( '“Quoted String”', wptexturize( '"Quoted String"' ) );89 // $this->assert Equals( '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>"' ) );90 // $this->assert Equals( '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>".' ) );91 $this->assert Equals( '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.' ) );92 $this->assert Equals( '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"' ) );93 // $this->assert Equals( '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.' ) );94 // $this->assert Equals( '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.' ) );95 // $this->assert Equals( '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.' ) );96 // $this->assert Equals( '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.' ) );97 // $this->assert Equals( '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>".' ) );98 // $this->assert Equals( '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.' ) );99 $this->assert Equals( 'A test with a finishing number, “like 23”.', wptexturize( 'A test with a finishing number, "like 23".' ) );100 $this->assert Equals( 'A test with a number, “like 62”, is nice to have.', wptexturize( 'A test with a number, "like 62", is nice to have.' ) );88 $this->assertSame( '“Quoted String”', wptexturize( '"Quoted String"' ) ); 89 // $this->assertSame( '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>"' ) ); 90 // $this->assertSame( '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>".' ) ); 91 $this->assertSame( '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.' ) ); 92 $this->assertSame( '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"' ) ); 93 // $this->assertSame( '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.' ) ); 94 // $this->assertSame( '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.' ) ); 95 // $this->assertSame( '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.' ) ); 96 // $this->assertSame( '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.' ) ); 97 // $this->assertSame( '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>".' ) ); 98 // $this->assertSame( '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.' ) ); 99 $this->assertSame( 'A test with a finishing number, “like 23”.', wptexturize( 'A test with a finishing number, "like 23".' ) ); 100 $this->assertSame( 'A test with a number, “like 62”, is nice to have.', wptexturize( 'A test with a number, "like 62", is nice to have.' ) ); 101 101 } 102 102 … … 105 105 */ 106 106 function test_quotes_before_s() { 107 $this->assert Equals( 'test’s', wptexturize( "test's" ) );108 $this->assert Equals( '‘test’s', wptexturize( "'test's" ) );109 $this->assert Equals( '‘test’s’', wptexturize( "'test's'" ) );110 $this->assert Equals( '‘string’', wptexturize( "'string'" ) );111 $this->assert Equals( '‘string’s’', wptexturize( "'string's'" ) );107 $this->assertSame( 'test’s', wptexturize( "test's" ) ); 108 $this->assertSame( '‘test’s', wptexturize( "'test's" ) ); 109 $this->assertSame( '‘test’s’', wptexturize( "'test's'" ) ); 110 $this->assertSame( '‘string’', wptexturize( "'string'" ) ); 111 $this->assertSame( '‘string’s’', wptexturize( "'string's'" ) ); 112 112 } 113 113 … … 116 116 */ 117 117 function test_quotes_before_numbers() { 118 $this->assert Equals( 'Class of ’99', wptexturize( "Class of '99" ) );119 $this->assert Equals( 'Class of ’99’s', wptexturize( "Class of '99's" ) );120 $this->assert Equals( '‘Class of ’99’', wptexturize( "'Class of '99'" ) );121 $this->assert Equals( '‘Class of ’99’ ', wptexturize( "'Class of '99' " ) );122 $this->assert Equals( '‘Class of ’99’.', wptexturize( "'Class of '99'." ) );123 $this->assert Equals( '‘Class of ’99’, she said', wptexturize( "'Class of '99', she said" ) );124 $this->assert Equals( '‘Class of ’99’:', wptexturize( "'Class of '99':" ) );125 $this->assert Equals( '‘Class of ’99’;', wptexturize( "'Class of '99';" ) );126 $this->assert Equals( '‘Class of ’99’!', wptexturize( "'Class of '99'!" ) );127 $this->assert Equals( '‘Class of ’99’?', wptexturize( "'Class of '99'?" ) );128 $this->assert Equals( '‘Class of ’99’s’', wptexturize( "'Class of '99's'" ) );129 $this->assert Equals( '‘Class of ’99’s’', wptexturize( "'Class of '99’s'" ) );130 $this->assert Equals( '“Class of 99”', wptexturize( '"Class of 99"' ) );131 $this->assert Equals( '“Class of ’99”', wptexturize( "\"Class of '99\"" ) );132 $this->assert Equals( '{“Class of ’99”}', wptexturize( "{\"Class of '99\"}" ) );133 $this->assert Equals( ' “Class of ’99” ', wptexturize( " \"Class of '99\" " ) );134 $this->assert Equals( ' “Class of ’99”.', wptexturize( " \"Class of '99\"." ) );135 $this->assert Equals( ' “Class of ’99”, she said', wptexturize( " \"Class of '99\", she said" ) );136 $this->assert Equals( ' “Class of ’99”:', wptexturize( " \"Class of '99\":" ) );137 $this->assert Equals( ' “Class of ’99”;', wptexturize( " \"Class of '99\";" ) );138 $this->assert Equals( ' “Class of ’99”!', wptexturize( " \"Class of '99\"!" ) );139 $this->assert Equals( ' “Class of ’99”?', wptexturize( " \"Class of '99\"?" ) );118 $this->assertSame( 'Class of ’99', wptexturize( "Class of '99" ) ); 119 $this->assertSame( 'Class of ’99’s', wptexturize( "Class of '99's" ) ); 120 $this->assertSame( '‘Class of ’99’', wptexturize( "'Class of '99'" ) ); 121 $this->assertSame( '‘Class of ’99’ ', wptexturize( "'Class of '99' " ) ); 122 $this->assertSame( '‘Class of ’99’.', wptexturize( "'Class of '99'." ) ); 123 $this->assertSame( '‘Class of ’99’, she said', wptexturize( "'Class of '99', she said" ) ); 124 $this->assertSame( '‘Class of ’99’:', wptexturize( "'Class of '99':" ) ); 125 $this->assertSame( '‘Class of ’99’;', wptexturize( "'Class of '99';" ) ); 126 $this->assertSame( '‘Class of ’99’!', wptexturize( "'Class of '99'!" ) ); 127 $this->assertSame( '‘Class of ’99’?', wptexturize( "'Class of '99'?" ) ); 128 $this->assertSame( '‘Class of ’99’s’', wptexturize( "'Class of '99's'" ) ); 129 $this->assertSame( '‘Class of ’99’s’', wptexturize( "'Class of '99’s'" ) ); 130 $this->assertSame( '“Class of 99”', wptexturize( '"Class of 99"' ) ); 131 $this->assertSame( '“Class of ’99”', wptexturize( "\"Class of '99\"" ) ); 132 $this->assertSame( '{“Class of ’99”}', wptexturize( "{\"Class of '99\"}" ) ); 133 $this->assertSame( ' “Class of ’99” ', wptexturize( " \"Class of '99\" " ) ); 134 $this->assertSame( ' “Class of ’99”.', wptexturize( " \"Class of '99\"." ) ); 135 $this->assertSame( ' “Class of ’99”, she said', wptexturize( " \"Class of '99\", she said" ) ); 136 $this->assertSame( ' “Class of ’99”:', wptexturize( " \"Class of '99\":" ) ); 137 $this->assertSame( ' “Class of ’99”;', wptexturize( " \"Class of '99\";" ) ); 138 $this->assertSame( ' “Class of ’99”!', wptexturize( " \"Class of '99\"!" ) ); 139 $this->assertSame( ' “Class of ’99”?', wptexturize( " \"Class of '99\"?" ) ); 140 140 // Not a quotation, may be between two other quotations. 141 $this->assert Equals( '}”Class of ’99″{', wptexturize( "}\"Class of '99\"{" ) );141 $this->assertSame( '}”Class of ’99″{', wptexturize( "}\"Class of '99\"{" ) ); 142 142 } 143 143 144 144 function test_quotes_after_numbers() { 145 $this->assert Equals( 'Class of ’99', wptexturize( "Class of '99" ) );145 $this->assertSame( 'Class of ’99', wptexturize( "Class of '99" ) ); 146 146 } 147 147 … … 151 151 */ 152 152 function test_other_html() { 153 $this->assert Equals( '‘<strong>', wptexturize( "'<strong>" ) );154 // $this->assert Equals( '‘<strong>Quoted Text</strong>’,', wptexturize( "'<strong>Quoted Text</strong>'," ) );155 // $this->assert Equals( '“<strong>Quoted Text</strong>”,', wptexturize( '"<strong>Quoted Text</strong>",' ) );153 $this->assertSame( '‘<strong>', wptexturize( "'<strong>" ) ); 154 // $this->assertSame( '‘<strong>Quoted Text</strong>’,', wptexturize( "'<strong>Quoted Text</strong>'," ) ); 155 // $this->assertSame( '“<strong>Quoted Text</strong>”,', wptexturize( '"<strong>Quoted Text</strong>",' ) ); 156 156 } 157 157 158 158 function test_x() { 159 $this->assert Equals( '14×24', wptexturize( '14x24' ) );159 $this->assertSame( '14×24', wptexturize( '14x24' ) ); 160 160 } 161 161 162 162 function test_minutes_seconds() { 163 $this->assert Equals( '9′', wptexturize( '9\'' ) );164 $this->assert Equals( '9″', wptexturize( '9"' ) );165 166 $this->assert Equals( 'a 9′ b', wptexturize( 'a 9\' b' ) );167 $this->assert Equals( 'a 9″ b', wptexturize( 'a 9" b' ) );168 169 $this->assert Equals( '“a 9′ b”', wptexturize( '"a 9\' b"' ) );170 $this->assert Equals( '‘a 9″ b’', wptexturize( "'a 9\" b'" ) );163 $this->assertSame( '9′', wptexturize( '9\'' ) ); 164 $this->assertSame( '9″', wptexturize( '9"' ) ); 165 166 $this->assertSame( 'a 9′ b', wptexturize( 'a 9\' b' ) ); 167 $this->assertSame( 'a 9″ b', wptexturize( 'a 9" b' ) ); 168 169 $this->assertSame( '“a 9′ b”', wptexturize( '"a 9\' b"' ) ); 170 $this->assertSame( '‘a 9″ b’', wptexturize( "'a 9\" b'" ) ); 171 171 } 172 172 … … 175 175 */ 176 176 function test_wptexturize_quotes_around_numbers() { 177 $this->assert Equals( '“12345”', wptexturize( '"12345"' ) );178 $this->assert Equals( '‘12345’', wptexturize( '\'12345\'' ) );179 $this->assert Equals( '“a 9′ plus a ‘9’, maybe a 9′ ‘9’”', wptexturize( '"a 9\' plus a \'9\', maybe a 9\' \'9\'"' ) );180 $this->assert Equals( '<p>’99<br />‘123’<br />’tis<br />‘s’</p>', wptexturize( '<p>\'99<br />\'123\'<br />\'tis<br />\'s\'</p>' ) );177 $this->assertSame( '“12345”', wptexturize( '"12345"' ) ); 178 $this->assertSame( '‘12345’', wptexturize( '\'12345\'' ) ); 179 $this->assertSame( '“a 9′ plus a ‘9’, maybe a 9′ ‘9’”', wptexturize( '"a 9\' plus a \'9\', maybe a 9\' \'9\'"' ) ); 180 $this->assertSame( '<p>’99<br />‘123’<br />’tis<br />‘s’</p>', wptexturize( '<p>\'99<br />\'123\'<br />\'tis<br />\'s\'</p>' ) ); 181 181 } 182 182 … … 185 185 */ 186 186 function test_wptexturize_html_comments() { 187 $this->assert Equals( '<!--[if !IE]>--><!--<![endif]-->', wptexturize( '<!--[if !IE]>--><!--<![endif]-->' ) );188 $this->assert Equals( '<!--[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]-->' ) );189 $this->assert Equals( '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>', wptexturize( '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>' ) );187 $this->assertSame( '<!--[if !IE]>--><!--<![endif]-->', wptexturize( '<!--[if !IE]>--><!--<![endif]-->' ) ); 188 $this->assertSame( '<!--[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]-->' ) ); 189 $this->assertSame( '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>', wptexturize( '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>' ) ); 190 190 } 191 191 … … 195 195 */ 196 196 function test_entity_quote_cuddling() { 197 $this->assert Equals( ' “Testing”', wptexturize( ' "Testing"' ) );198 // $this->assert Equals( '&“Testing”', wptexturize( '&"Testing"' ) );197 $this->assertSame( ' “Testing”', wptexturize( ' "Testing"' ) ); 198 // $this->assertSame( '&“Testing”', wptexturize( '&"Testing"' ) ); 199 199 } 200 200 … … 203 203 */ 204 204 function test_apostrophes_before_primes() { 205 $this->assert Equals( 'WordPress 3.5’s release date', wptexturize( "WordPress 3.5's release date" ) );205 $this->assertSame( 'WordPress 3.5’s release date', wptexturize( "WordPress 3.5's release date" ) ); 206 206 } 207 207 … … 212 212 $nbsp = "\xC2\xA0"; 213 213 214 $this->assert Equals( ' – ', wptexturize( ' - ' ) );215 $this->assert Equals( ' – ', wptexturize( ' - ' ) );216 $this->assert Equals( ' – ', wptexturize( ' - ' ) );217 $this->assert Equals( ' – ', wptexturize( ' - ' ) );218 $this->assert Equals( "$nbsp–$nbsp", wptexturize( "$nbsp-$nbsp" ) );219 $this->assert Equals( " –$nbsp", wptexturize( " -$nbsp" ) );220 $this->assert Equals( "$nbsp– ", wptexturize( "$nbsp- " ) );221 222 $this->assert Equals( ' — ', wptexturize( ' -- ' ) );223 $this->assert Equals( ' — ', wptexturize( ' -- ' ) );224 $this->assert Equals( ' — ', wptexturize( ' -- ' ) );225 $this->assert Equals( ' — ', wptexturize( ' -- ' ) );226 $this->assert Equals( "$nbsp—$nbsp", wptexturize( "$nbsp--$nbsp" ) );227 $this->assert Equals( " —$nbsp", wptexturize( " --$nbsp" ) );228 $this->assert Equals( "$nbsp— ", wptexturize( "$nbsp-- " ) );214 $this->assertSame( ' – ', wptexturize( ' - ' ) ); 215 $this->assertSame( ' – ', wptexturize( ' - ' ) ); 216 $this->assertSame( ' – ', wptexturize( ' - ' ) ); 217 $this->assertSame( ' – ', wptexturize( ' - ' ) ); 218 $this->assertSame( "$nbsp–$nbsp", wptexturize( "$nbsp-$nbsp" ) ); 219 $this->assertSame( " –$nbsp", wptexturize( " -$nbsp" ) ); 220 $this->assertSame( "$nbsp– ", wptexturize( "$nbsp- " ) ); 221 222 $this->assertSame( ' — ', wptexturize( ' -- ' ) ); 223 $this->assertSame( ' — ', wptexturize( ' -- ' ) ); 224 $this->assertSame( ' — ', wptexturize( ' -- ' ) ); 225 $this->assertSame( ' — ', wptexturize( ' -- ' ) ); 226 $this->assertSame( "$nbsp—$nbsp", wptexturize( "$nbsp--$nbsp" ) ); 227 $this->assertSame( " —$nbsp", wptexturize( " --$nbsp" ) ); 228 $this->assertSame( "$nbsp— ", wptexturize( "$nbsp-- " ) ); 229 229 } 230 230 … … 233 233 */ 234 234 function test_hyphens_at_start_and_end() { 235 $this->assert Equals( '– ', wptexturize( '- ' ) );236 $this->assert Equals( '– –', wptexturize( '- -' ) );237 $this->assert Equals( ' –', wptexturize( ' -' ) );238 239 $this->assert Equals( '— ', wptexturize( '-- ' ) );240 $this->assert Equals( '— —', wptexturize( '-- --' ) );241 $this->assert Equals( ' —', wptexturize( ' --' ) );235 $this->assertSame( '– ', wptexturize( '- ' ) ); 236 $this->assertSame( '– –', wptexturize( '- -' ) ); 237 $this->assertSame( ' –', wptexturize( ' -' ) ); 238 239 $this->assertSame( '— ', wptexturize( '-- ' ) ); 240 $this->assertSame( '— —', wptexturize( '-- --' ) ); 241 $this->assertSame( ' —', wptexturize( ' --' ) ); 242 242 } 243 243 … … 267 267 */ 268 268 function test_spaces_around_quotes( $input, $output ) { 269 return $this->assert Equals( $output, wptexturize( $input ) );269 return $this->assertSame( $output, wptexturize( $input ) ); 270 270 } 271 271 … … 323 323 */ 324 324 function test_apos_before_digits( $input, $output ) { 325 return $this->assert Equals( $output, wptexturize( $input ) );325 return $this->assertSame( $output, wptexturize( $input ) ); 326 326 } 327 327 … … 364 364 */ 365 365 function test_opening_single_quote( $input, $output ) { 366 return $this->assert Equals( $output, wptexturize( $input ) );366 return $this->assertSame( $output, wptexturize( $input ) ); 367 367 } 368 368 … … 493 493 */ 494 494 function test_double_prime( $input, $output ) { 495 return $this->assert Equals( $output, wptexturize( $input ) );495 return $this->assertSame( $output, wptexturize( $input ) ); 496 496 } 497 497 … … 526 526 */ 527 527 function test_single_prime( $input, $output ) { 528 return $this->assert Equals( $output, wptexturize( $input ) );528 return $this->assertSame( $output, wptexturize( $input ) ); 529 529 } 530 530 … … 559 559 */ 560 560 function test_contractions( $input, $output ) { 561 return $this->assert Equals( $output, wptexturize( $input ) );561 return $this->assertSame( $output, wptexturize( $input ) ); 562 562 } 563 563 … … 600 600 */ 601 601 function test_opening_quote( $input, $output ) { 602 return $this->assert Equals( $output, wptexturize( $input ) );602 return $this->assertSame( $output, wptexturize( $input ) ); 603 603 } 604 604 … … 677 677 */ 678 678 function test_closing_quote( $input, $output ) { 679 return $this->assert Equals( $output, wptexturize( $input ) );679 return $this->assertSame( $output, wptexturize( $input ) ); 680 680 } 681 681 … … 766 766 */ 767 767 function test_closing_single_quote( $input, $output ) { 768 return $this->assert Equals( $output, wptexturize( $input ) );768 return $this->assertSame( $output, wptexturize( $input ) ); 769 769 } 770 770 … … 856 856 */ 857 857 function test_multiplication( $input, $output ) { 858 return $this->assert Equals( $output, wptexturize( $input ) );858 return $this->assertSame( $output, wptexturize( $input ) ); 859 859 } 860 860 … … 906 906 */ 907 907 function test_ampersand( $input, $output ) { 908 return $this->assert Equals( $output, wptexturize( $input ) );908 return $this->assertSame( $output, wptexturize( $input ) ); 909 909 } 910 910 … … 971 971 */ 972 972 function test_cockney( $input, $output ) { 973 return $this->assert Equals( $output, wptexturize( $input ) );973 return $this->assertSame( $output, wptexturize( $input ) ); 974 974 } 975 975 … … 1032 1032 */ 1033 1033 function test_smart_dashes( $input, $output ) { 1034 return $this->assert Equals( $output, wptexturize( $input ) );1034 return $this->assertSame( $output, wptexturize( $input ) ); 1035 1035 } 1036 1036 … … 1085 1085 */ 1086 1086 function test_misc_static_replacements( $input, $output ) { 1087 return $this->assert Equals( $output, wptexturize( $input ) );1087 return $this->assertSame( $output, wptexturize( $input ) ); 1088 1088 } 1089 1089 … … 1140 1140 */ 1141 1141 function test_quoted_numbers( $input, $output ) { 1142 return $this->assert Equals( $output, wptexturize( $input ) );1142 return $this->assertSame( $output, wptexturize( $input ) ); 1143 1143 } 1144 1144 … … 1191 1191 */ 1192 1192 function test_quotes_and_dashes( $input, $output ) { 1193 return $this->assert Equals( $output, wptexturize( $input ) );1193 return $this->assertSame( $output, wptexturize( $input ) ); 1194 1194 } 1195 1195 … … 1254 1254 */ 1255 1255 function test_tag_avoidance( $input, $output ) { 1256 return $this->assert Equals( $output, wptexturize( $input ) );1256 return $this->assertSame( $output, wptexturize( $input ) ); 1257 1257 } 1258 1258 … … 1477 1477 */ 1478 1478 function test_year_abbr( $input, $output ) { 1479 return $this->assert Equals( $output, wptexturize( $input ) );1479 return $this->assertSame( $output, wptexturize( $input ) ); 1480 1480 } 1481 1481 … … 1573 1573 wptexturize( 'reset', true ); 1574 1574 1575 return $this->assert Equals( $output, $result );1575 return $this->assertSame( $output, $result ); 1576 1576 } 1577 1577 … … 1793 1793 */ 1794 1794 function test_element_stack( $input, $output ) { 1795 return $this->assert Equals( $output, wptexturize( $input ) );1795 return $this->assertSame( $output, wptexturize( $input ) ); 1796 1796 } 1797 1797 … … 1846 1846 add_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 ); 1847 1847 1848 $output = $this->assert Equals( $output, wptexturize( $input ) );1848 $output = $this->assertSame( $output, wptexturize( $input ) ); 1849 1849 1850 1850 remove_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 ); … … 1929 1929 */ 1930 1930 function test_primes_vs_quotes( $input, $output ) { 1931 return $this->assert Equals( $output, wptexturize( $input ) );1931 return $this->assertSame( $output, wptexturize( $input ) ); 1932 1932 } 1933 1933 … … 1998 1998 wptexturize( 'reset', true ); 1999 1999 2000 return $this->assert Equals( $output, $result );2000 return $this->assertSame( $output, $result ); 2001 2001 } 2002 2002 … … 2104 2104 */ 2105 2105 function test_trailing_less_than() { 2106 $this->assert Equals( 'F–oo<', wptexturize( 'F--oo<', true ) );2106 $this->assertSame( 'F–oo<', wptexturize( 'F--oo<', true ) ); 2107 2107 } 2108 2108
Note: See TracChangeset
for help on using the changeset viewer.