| 588 | /** |
| 589 | * @ticket 33016 |
| 590 | */ |
| 591 | function test_multiline_cdata() { |
| 592 | global $wp_embed; |
| 593 | |
| 594 | $content = <<<EOF |
| 595 | <script>// <![CDATA[ |
| 596 | _my_function('data'); |
| 597 | // ]]> |
| 598 | </script> |
| 599 | EOF; |
| 600 | |
| 601 | $result = $wp_embed->autoembed( $content ); |
| 602 | $this->assertEquals( $content, $result ); |
| 603 | } |
| 604 | |
| 605 | /** |
| 606 | * @ticket 33016 |
| 607 | */ |
| 608 | function test_multiline_comment() { |
| 609 | global $wp_embed; |
| 610 | |
| 611 | $content = <<<EOF |
| 612 | <script><!-- |
| 613 | my_function(); |
| 614 | // --> </script> |
| 615 | EOF; |
| 616 | |
| 617 | $result = $wp_embed->autoembed( $content ); |
| 618 | $this->assertEquals( $content, $result ); |
| 619 | } |
| 620 | |
| 621 | |
| 622 | /** |
| 623 | * @ticket 33016 |
| 624 | */ |
| 625 | function test_multiline_comment_with_embeds() { |
| 626 | global $wp_embed; |
| 627 | |
| 628 | $content = <<<EOF |
| 629 | Start. |
| 630 | [embed]http://www.youtube.com/embed/TEST01YRHA0[/embed] |
| 631 | <script><!-- |
| 632 | my_function(); |
| 633 | // --> </script> |
| 634 | http://www.youtube.com/embed/TEST02YRHA0 |
| 635 | [embed]http://www.example.com/embed/TEST03YRHA0[/embed] |
| 636 | http://www.example.com/embed/TEST04YRHA0 |
| 637 | Stop. |
| 638 | EOF; |
| 639 | |
| 640 | $expected = <<<EOF |
| 641 | <p>Start.<br /> |
| 642 | https://youtube.com/watch?v=TEST01YRHA0<br /> |
| 643 | <script><!-- |
| 644 | my_function(); |
| 645 | // --> </script><br /> |
| 646 | https://youtube.com/watch?v=TEST02YRHA0<br /> |
| 647 | <a href="http://www.example.com/embed/TEST03YRHA0">http://www.example.com/embed/TEST03YRHA0</a><br /> |
| 648 | http://www.example.com/embed/TEST04YRHA0<br /> |
| 649 | Stop.</p> |
| 650 | |
| 651 | EOF; |
| 652 | |
| 653 | $result = apply_filters('the_content', $content ); |
| 654 | $this->assertEquals( $expected, $result ); |
| 655 | } |