| @@ 12-20 (lines=9) @@ | ||
| 9 | /** |
|
| 10 | * @ticket 23605 |
|
| 11 | */ |
|
| 12 | function test_spaces() |
|
| 13 | { |
|
| 14 | $this->assertEquals('http://example.com/Mr%20WordPress', esc_url('http://example.com/Mr WordPress')); |
|
| 15 | $this->assertEquals('http://example.com/Mr%20WordPress', esc_url('http://example.com/Mr%20WordPress')); |
|
| 16 | $this->assertEquals('http://example.com/Mr%20%20WordPress', esc_url('http://example.com/Mr%20%20WordPress')); |
|
| 17 | $this->assertEquals('http://example.com/Mr+WordPress', esc_url('http://example.com/Mr+WordPress')); |
|
| 18 | ||
| 19 | $this->assertEquals('http://example.com/?foo=one%20two%20three&bar=four', esc_url('http://example.com/?foo=one two three&bar=four')); |
|
| 20 | $this->assertEquals('http://example.com/?foo=one%20two%20three&bar=four', esc_url('http://example.com/?foo=one%20two%20three&bar=four')); |
|
| 21 | } |
|
| 22 | ||
| 23 | function test_bad_characters() |
|
| @@ 257-266 (lines=10) @@ | ||
| 254 | /** |
|
| 255 | * @ticket 34202 |
|
| 256 | */ |
|
| 257 | function test_ipv6_hosts() |
|
| 258 | { |
|
| 259 | $this->assertEquals('//[::127.0.0.1]', esc_url('//[::127.0.0.1]')); |
|
| 260 | $this->assertEquals('http://[::FFFF::127.0.0.1]', esc_url('http://[::FFFF::127.0.0.1]')); |
|
| 261 | $this->assertEquals('http://[::127.0.0.1]', esc_url('http://[::127.0.0.1]')); |
|
| 262 | $this->assertEquals('http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]', esc_url('http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]')); |
|
| 263 | ||
| 264 | // IPv6 with square brackets in the query? Why not. |
|
| 265 | $this->assertEquals('//[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url('//[::FFFF::127.0.0.1]/?foo[bar]=baz')); |
|
| 266 | $this->assertEquals('http://[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url('http://[::FFFF::127.0.0.1]/?foo[bar]=baz')); |
|
| 267 | } |
|
| 268 | ||
| 269 | } |
|
| @@ 168-177 (lines=10) @@ | ||
| 165 | $this->assertEquals('14×24', wptexturize("14x24")); |
|
| 166 | } |
|
| 167 | ||
| 168 | function test_minutes_seconds() |
|
| 169 | { |
|
| 170 | $this->assertEquals('9′', wptexturize('9\'')); |
|
| 171 | $this->assertEquals('9″', wptexturize("9\"")); |
|
| 172 | ||
| 173 | $this->assertEquals('a 9′ b', wptexturize('a 9\' b')); |
|
| 174 | $this->assertEquals('a 9″ b', wptexturize("a 9\" b")); |
|
| 175 | ||
| 176 | $this->assertEquals('“a 9′ b”', wptexturize('"a 9\' b"')); |
|
| 177 | $this->assertEquals('‘a 9″ b’', wptexturize("'a 9\" b'")); |
|
| 178 | } |
|
| 179 | ||
| 180 | /** |
|
| @@ 246-254 (lines=9) @@ | ||
| 243 | /** |
|
| 244 | * @ticket 31030 |
|
| 245 | */ |
|
| 246 | function test_hyphens_at_start_and_end() |
|
| 247 | { |
|
| 248 | $this->assertEquals('– ', wptexturize('- ')); |
|
| 249 | $this->assertEquals('– –', wptexturize('- -')); |
|
| 250 | $this->assertEquals(' –', wptexturize(' -')); |
|
| 251 | ||
| 252 | $this->assertEquals('— ', wptexturize('-- ')); |
|
| 253 | $this->assertEquals('— —', wptexturize('-- --')); |
|
| 254 | $this->assertEquals(' —', wptexturize(' --')); |
|
| 255 | } |
|
| 256 | ||
| 257 | /** |
|