You appear to be a bot. Output may be restricted
Description
Usage
Tests_Media::test_oembed_explicit_media_link();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/media.php
Lines:
1 to 32 of 32
function test_oembed_explicit_media_link() { global $wp_embed; add_filter( 'embed_maybe_make_link', array( $this, 'filter_wp_embed_shortcode_custom' ), 10, 2 ); $content = <<<EOF https://www.example.com/?video=1 EOF; $expected = <<<EOF @embed URL was replaced@ EOF; $result = $wp_embed->autoembed( $content ); $this->assertEquals( $expected, $result ); $content = <<<EOF <a href="https://www.example.com/?video=1">https://www.example.com/?video=1</a> <script>// <![CDATA[ _my_function('data'); myvar = 'Hello world https://www.example.com/?video=1 do not break this'; // ]]> </script> EOF; $result = $wp_embed->autoembed( $content ); $this->assertEquals( $content, $result ); remove_filter( 'embed_maybe_make_link', array( $this, 'filter_wp_embed_shortcode_custom' ), 10 ); }