-
Notifications
You must be signed in to change notification settings - Fork 805
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reverse old embed HTML if it has videopress URLs in it (#14249)
* Reverse old embed HTML if it has videopress URLs in it to an oembed-able link.
- Loading branch information
1 parent
d026d45
commit 3a0fb0b
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/php/modules/videopress/test_functions.utility-functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Class WP_Test_Jetpack_VideoPress_Utility_Functions | ||
* | ||
* Note that modules/videopress/utility-functions.php is automatically loaded and does not need to be required in this file. | ||
* | ||
* @package Jetpack | ||
*/ | ||
|
||
/** | ||
* Tests Jetpack_VideoPress_Utility_Functions | ||
*/ | ||
class WP_Test_Jetpack_VideoPress_Utility_Functions extends WP_UnitTestCase { | ||
|
||
/** | ||
* Tests the VideoPress Flash to oEmbedable URL filter. | ||
* | ||
* @author kraftbj | ||
* @covers jetpack_videopress_flash_embed_filter | ||
* @since 8.1.0 | ||
*/ | ||
public function test_jetpack_videopress_flash_embed_filter_flash() { | ||
$content = '<p><embed src="http://v.wordpress.com/YtfS78jH" type="application/x-shockwave-flash" width="600" height="338"></embed></p>'; | ||
$contains = 'https://videopress.com/v/YtfS78jH'; | ||
|
||
$filtered = jetpack_videopress_flash_embed_filter( $content ); | ||
|
||
$this->assertContains( $contains, $filtered ); | ||
} | ||
|
||
} |