| | 1 | <?php |
| | 2 | |
| | 3 | /** |
| | 4 | * @group formatting |
| | 5 | */ |
| | 6 | class Tests_Formatting_Autoembed extends WP_UnitTestCase { |
| | 7 | |
| | 8 | /** |
| | 9 | * @covers WP_Embed::autoembed |
| | 10 | * @covers WP_Embed::autoembed_callback |
| | 11 | */ |
| | 12 | public function test_autoembed_empty() { |
| | 13 | $embed = new WP_Embed(); |
| | 14 | $content = ''; |
| | 15 | |
| | 16 | $result = $embed->autoembed( $content ); |
| | 17 | $this->assertEquals( $content, $result ); |
| | 18 | } |
| | 19 | |
| | 20 | /** |
| | 21 | * @covers WP_Embed::autoembed |
| | 22 | * @covers WP_Embed::autoembed_callback |
| | 23 | * @ticket 23776 |
| | 24 | */ |
| | 25 | public function test_autoembed_no_http_paragraph() { |
| | 26 | $embed = new WP_Embed(); |
| | 27 | $content = "$ my command\nFirst line.\n\nhttp://example.com/1/\nhttp://example.com/2/\nLast line."; |
| | 28 | |
| | 29 | $result = $embed->autoembed( $content ); |
| | 30 | $this->assertEquals( $content, $result ); |
| | 31 | } |
| | 32 | |
| | 33 | } |