diff options
Diffstat (limited to 'tests/phpunit')
-rw-r--r-- | tests/phpunit/tests/media.php | 6 | ||||
-rw-r--r-- | tests/phpunit/tests/oembed/WpEmbed.php | 18 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index 055618f620..bc9b593d15 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -280,6 +280,8 @@ CAP; /** * @ticket 23776 + * + * @group external-http */ function test_autoembed_no_paragraphs_around_urls() { global $wp_embed; @@ -1280,6 +1282,8 @@ EOF; /** * @ticket 33016 + * + * @group external-http */ function test_multiline_comment_with_embeds() { $content = <<<EOF @@ -1323,6 +1327,8 @@ EOF; /** * @ticket 33016 + * + * @group external-http */ function test_oembed_explicit_media_link() { global $wp_embed; diff --git a/tests/phpunit/tests/oembed/WpEmbed.php b/tests/phpunit/tests/oembed/WpEmbed.php index fea9500d47..b01ca75eff 100644 --- a/tests/phpunit/tests/oembed/WpEmbed.php +++ b/tests/phpunit/tests/oembed/WpEmbed.php @@ -105,6 +105,9 @@ class Tests_WP_Embed extends WP_UnitTestCase { $this->assertArrayNotHasKey( 'youtube_embed_url', $handlers ); } + /** + * @group external-http + */ public function test_autoembed_should_do_nothing_without_matching_handler() { $content = "\nhttp://example.com/embed/foo\n"; @@ -112,6 +115,9 @@ class Tests_WP_Embed extends WP_UnitTestCase { $this->assertSame( $content, $actual ); } + /** + * @group external-http + */ public function test_autoembed_should_return_modified_content() { $handle = __FUNCTION__; $regex = '#https?://example\.com/embed/([^/]+)#i'; @@ -317,6 +323,9 @@ class Tests_WP_Embed extends WP_UnitTestCase { remove_filter( 'oembed_ttl', '__return_zero' ); } + /** + * @group external-http + */ public function test_shortcode_should_get_url_from_src_attribute() { $url = 'http://example.com/embed/foo'; $actual = $this->wp_embed->shortcode( array( 'src' => $url ) ); @@ -324,10 +333,16 @@ class Tests_WP_Embed extends WP_UnitTestCase { $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual ); } + /** + * @group external-http + */ public function test_shortcode_should_return_empty_string_for_missing_url() { $this->assertEmpty( $this->wp_embed->shortcode( array() ) ); } + /** + * @group external-http + */ public function test_shortcode_should_make_link_for_unknown_url() { $url = 'http://example.com/embed/foo'; $actual = $this->wp_embed->shortcode( array(), $url ); @@ -335,6 +350,9 @@ class Tests_WP_Embed extends WP_UnitTestCase { $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual ); } + /** + * @group external-http + */ public function test_run_shortcode_url_only() { $url = 'http://example.com/embed/foo'; $actual = $this->wp_embed->run_shortcode( '[embed]' . $url . '[/embed]' ); |