| @@ 16-35 (lines=20) @@ | ||
| 13 | return $this->assertEquals( $output, wp_replace_in_html_tags( $input, array( "\n" => " " ) ) ); |
|
| 14 | } |
|
| 15 | ||
| 16 | function data_wp_replace_in_html_tags() { |
|
| 17 | return array( |
|
| 18 | array( |
|
| 19 | "Hello \n World", |
|
| 20 | "Hello \n World", |
|
| 21 | ), |
|
| 22 | array( |
|
| 23 | "<Hello \n World>", |
|
| 24 | "<Hello World>", |
|
| 25 | ), |
|
| 26 | array( |
|
| 27 | "<!-- Hello \n World -->", |
|
| 28 | "<!-- Hello World -->", |
|
| 29 | ), |
|
| 30 | array( |
|
| 31 | "<!-- Hello <\n> World -->", |
|
| 32 | "<!-- Hello < > World -->", |
|
| 33 | ), |
|
| 34 | ); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ?> |
|
| @@ 491-510 (lines=20) @@ | ||
| 488 | return $this->assertEquals( $output, wptexturize( $input ) ); |
|
| 489 | } |
|
| 490 | ||
| 491 | function data_double_prime() { |
|
| 492 | return array( |
|
| 493 | array( |
|
| 494 | 'word 99" word', |
|
| 495 | 'word 99″ word', |
|
| 496 | ), |
|
| 497 | array( |
|
| 498 | 'word 99"word', |
|
| 499 | 'word 99″word', |
|
| 500 | ), |
|
| 501 | array( |
|
| 502 | 'word99" word', |
|
| 503 | 'word99″ word', |
|
| 504 | ), |
|
| 505 | array( |
|
| 506 | 'word99"word', |
|
| 507 | 'word99″word', |
|
| 508 | ), |
|
| 509 | ); |
|
| 510 | } |
|
| 511 | ||
| 512 | /** |
|
| 513 | * Apostrophe after a number becomes ′ (prime) |
|
| @@ 524-543 (lines=20) @@ | ||
| 521 | return $this->assertEquals( $output, wptexturize( $input ) ); |
|
| 522 | } |
|
| 523 | ||
| 524 | function data_single_prime() { |
|
| 525 | return array( |
|
| 526 | array( |
|
| 527 | "word 99' word", |
|
| 528 | "word 99′ word", |
|
| 529 | ), |
|
| 530 | array( |
|
| 531 | "word 99'word", // Not a prime anymore. Apostrophes get priority. |
|
| 532 | "word 99’word", |
|
| 533 | ), |
|
| 534 | array( |
|
| 535 | "word99' word", |
|
| 536 | "word99′ word", |
|
| 537 | ), |
|
| 538 | array( |
|
| 539 | "word99'word", // Not a prime anymore. |
|
| 540 | "word99’word", |
|
| 541 | ), |
|
| 542 | ); |
|
| 543 | } |
|
| 544 | ||
| 545 | /** |
|
| 546 | * Apostrophe "in a word" becomes ’ (apos) |
|
| @@ 283-306 (lines=24) @@ | ||
| 280 | $this->assertEquals( $method, wp_remote_retrieve_body( $res ) ); |
|
| 281 | } |
|
| 282 | ||
| 283 | public function data_post_redirect_to_method_300() { |
|
| 284 | return array( |
|
| 285 | // Test 300 - POST to POST |
|
| 286 | array( |
|
| 287 | 300, |
|
| 288 | 'POST', |
|
| 289 | ), |
|
| 290 | // Test 301 - POST to POST |
|
| 291 | array( |
|
| 292 | 301, |
|
| 293 | 'POST', |
|
| 294 | ), |
|
| 295 | // Test 302 - POST to GET |
|
| 296 | array( |
|
| 297 | 302, |
|
| 298 | 'GET', |
|
| 299 | ), |
|
| 300 | // Test 303 - POST to GET |
|
| 301 | array( |
|
| 302 | 303, |
|
| 303 | 'GET', |
|
| 304 | ), |
|
| 305 | ); |
|
| 306 | } |
|
| 307 | ||
| 308 | /** |
|
| 309 | * Test HTTP Requests using an IP url, with a HOST header specified |
|
| @@ 89-96 (lines=8) @@ | ||
| 86 | $this->assertSame( $sanitized, sanitize_option( $option_name, $original ) ); |
|
| 87 | } |
|
| 88 | ||
| 89 | public function upload_path_provider() { |
|
| 90 | return array( |
|
| 91 | array( '<a href="http://www.example.com">Link</a>', 'Link' ), |
|
| 92 | array( '<scr' . 'ipt>url</scr' . 'ipt>', 'url' ), |
|
| 93 | array( '/path/to/things', '/path/to/things' ), |
|
| 94 | array( '\path\to\things', '\path\to\things' ), |
|
| 95 | ); |
|
| 96 | } |
|
| 97 | ||
| 98 | /** |
|
| 99 | * @dataProvider upload_path_provider |
|