Tests: Update third-party video URLs in unit tests with more permanent videos.

This brings some consistency to the YouTube and Vimeo URLs used for tests:

* For YouTube, use the video of WordPress 5.0 release.
* For Vimeo, use one of the official test videos.

Props garrett-eclipse, dd32.
Fixes #51487. See #meta5467.

git-svn-id: https://develop.svn.wordpress.org/trunk@49117 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-10-10 01:37:18 +00:00
parent 38beea2e3a
commit ac0e283045
7 changed files with 25 additions and 25 deletions

View File

@ -3613,7 +3613,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
function test_sanitize_external_header_video_trim() { function test_sanitize_external_header_video_trim() {
$this->manager->register_controls(); $this->manager->register_controls();
$setting = $this->manager->get_setting( 'external_header_video' ); $setting = $this->manager->get_setting( 'external_header_video' );
$video_url = 'https://www.youtube.com/watch?v=KiS8rZBeIO0'; $video_url = 'https://www.youtube.com/watch?v=72xdCU__XCk';
$whitespaces = array( $whitespaces = array(
' ', // Space. ' ', // Space.

View File

@ -289,7 +289,7 @@ class Tests_Formatting_MakeClickable extends WP_UnitTestCase {
"http://trunk.domain/testing#something (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)", "http://trunk.domain/testing#something (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
"http://trunk.domain/testing#something "http://trunk.domain/testing#something
(<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)", (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
"<span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/nd_BdvG43rE&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='http://www.youtube.com/v/nd_BdvG43rE&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='opaque'></embed> </object></span>", "<span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='https://www.youtube.com/watch?v=72xdCU__XCk&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='https://www.youtube.com/watch?v=72xdCU__XCk&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='opaque'></embed> </object></span>",
'<a href="http://example.com/example.gif" title="Image from http://example.com">Look at this image!</a>', '<a href="http://example.com/example.gif" title="Image from http://example.com">Look at this image!</a>',
); );
$urls_expected = array( $urls_expected = array(
@ -298,7 +298,7 @@ class Tests_Formatting_MakeClickable extends WP_UnitTestCase {
"<a href=\"http://trunk.domain/testing#something\" rel=\"nofollow\">http://trunk.domain/testing#something</a> (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)", "<a href=\"http://trunk.domain/testing#something\" rel=\"nofollow\">http://trunk.domain/testing#something</a> (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
"<a href=\"http://trunk.domain/testing#something\" rel=\"nofollow\">http://trunk.domain/testing#something</a> "<a href=\"http://trunk.domain/testing#something\" rel=\"nofollow\">http://trunk.domain/testing#something</a>
(<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)", (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
"<span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/nd_BdvG43rE&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='http://www.youtube.com/v/nd_BdvG43rE&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='opaque'></embed> </object></span>", "<span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='https://www.youtube.com/watch?v=72xdCU__XCk&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='https://www.youtube.com/watch?v=72xdCU__XCk&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='opaque'></embed> </object></span>",
'<a href="http://example.com/example.gif" title="Image from http://example.com">Look at this image!</a>', '<a href="http://example.com/example.gif" title="Image from http://example.com">Look at this image!</a>',
); );
foreach ( $urls_before as $key => $url ) { foreach ( $urls_before as $key => $url ) {

View File

@ -934,7 +934,7 @@ VIDEO;
function test_wp_video_shortcode_youtube_remove_feature() { function test_wp_video_shortcode_youtube_remove_feature() {
$actual = wp_video_shortcode( $actual = wp_video_shortcode(
array( array(
'src' => 'https://www.youtube.com/watch?v=i_cVJgIz_Cs&feature=youtu.be', 'src' => 'https://www.youtube.com/watch?v=72xdCU__XCk&feature=youtu.be',
) )
); );
@ -948,11 +948,11 @@ VIDEO;
function test_wp_video_shortcode_youtube_force_ssl() { function test_wp_video_shortcode_youtube_force_ssl() {
$actual = wp_video_shortcode( $actual = wp_video_shortcode(
array( array(
'src' => 'http://www.youtube.com/watch?v=i_cVJgIz_Cs', 'src' => 'http://www.youtube.com/watch?v=72xdCU__XCk',
) )
); );
$this->assertContains( 'src="https://www.youtube.com/watch?v=i_cVJgIz_Cs', $actual ); $this->assertContains( 'src="https://www.youtube.com/watch?v=72xdCU__XCk', $actual );
} }
/** /**
@ -962,11 +962,11 @@ VIDEO;
function test_wp_video_shortcode_vimeo_force_ssl_remove_query_args() { function test_wp_video_shortcode_vimeo_force_ssl_remove_query_args() {
$actual = wp_video_shortcode( $actual = wp_video_shortcode(
array( array(
'src' => 'http://vimeo.com/190372437?blah=meh', 'src' => 'http://vimeo.com/76979871?blah=meh',
) )
); );
$this->assertContains( 'src="https://vimeo.com/190372437', $actual ); $this->assertContains( 'src="https://vimeo.com/76979871', $actual );
$this->assertNotContains( 'blah=meh', $actual ); $this->assertNotContains( 'blah=meh', $actual );
} }
@ -977,11 +977,11 @@ VIDEO;
function test_wp_video_shortcode_vimeo_adds_loop() { function test_wp_video_shortcode_vimeo_adds_loop() {
$actual = wp_video_shortcode( $actual = wp_video_shortcode(
array( array(
'src' => 'http://vimeo.com/190372437', 'src' => 'http://vimeo.com/76979871',
) )
); );
$this->assertContains( 'src="https://vimeo.com/190372437?loop=0', $actual ); $this->assertContains( 'src="https://vimeo.com/76979871?loop=0', $actual );
} }
/** /**
@ -991,12 +991,12 @@ VIDEO;
function test_wp_video_shortcode_vimeo_force_adds_loop_true() { function test_wp_video_shortcode_vimeo_force_adds_loop_true() {
$actual = wp_video_shortcode( $actual = wp_video_shortcode(
array( array(
'src' => 'http://vimeo.com/190372437', 'src' => 'http://vimeo.com/76979871',
'loop' => true, 'loop' => true,
) )
); );
$this->assertContains( 'src="https://vimeo.com/190372437?loop=1', $actual ); $this->assertContains( 'src="https://vimeo.com/76979871?loop=1', $actual );
} }
/** /**

View File

@ -7,7 +7,7 @@ class Tests_Filter_oEmbed_Result extends WP_UnitTestCase {
function test_filter_oembed_result_trusted_malicious_iframe() { function test_filter_oembed_result_trusted_malicious_iframe() {
$html = '<p></p><iframe onload="alert(1)"></iframe>'; $html = '<p></p><iframe onload="alert(1)"></iframe>';
$actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' ); $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), 'https://www.youtube.com/watch?v=72xdCU__XCk' );
$this->assertSame( $html, $actual ); $this->assertSame( $html, $actual );
} }

View File

@ -11,7 +11,7 @@ class Tests_Filter_oEmbed_Iframe_Title_Attribute extends WP_UnitTestCase {
array( array(
'type' => 'rich', 'type' => 'rich',
), ),
'https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://www.youtube.com/watch?v=72xdCU__XCk',
'<p>Foo</p><iframe src=""></iframe><b>Bar</b>', '<p>Foo</p><iframe src=""></iframe><b>Bar</b>',
), ),
array( array(
@ -19,7 +19,7 @@ class Tests_Filter_oEmbed_Iframe_Title_Attribute extends WP_UnitTestCase {
array( array(
'type' => 'rich', 'type' => 'rich',
), ),
'https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://www.youtube.com/watch?v=72xdCU__XCk',
'<p>Foo</p><iframe title="Hello World" src=""></iframe><b>Bar</b>', '<p>Foo</p><iframe title="Hello World" src=""></iframe><b>Bar</b>',
), ),
array( array(
@ -28,7 +28,7 @@ class Tests_Filter_oEmbed_Iframe_Title_Attribute extends WP_UnitTestCase {
'type' => 'rich', 'type' => 'rich',
'title' => 'Hello World', 'title' => 'Hello World',
), ),
'https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://www.youtube.com/watch?v=72xdCU__XCk',
'<p>Foo</p>', '<p>Foo</p>',
), ),
array( array(
@ -37,7 +37,7 @@ class Tests_Filter_oEmbed_Iframe_Title_Attribute extends WP_UnitTestCase {
'type' => 'rich', 'type' => 'rich',
'title' => 'Hello World', 'title' => 'Hello World',
), ),
'https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://www.youtube.com/watch?v=72xdCU__XCk',
'<p title="Foo">Bar</p>', '<p title="Foo">Bar</p>',
), ),
array( array(
@ -46,7 +46,7 @@ class Tests_Filter_oEmbed_Iframe_Title_Attribute extends WP_UnitTestCase {
'type' => 'rich', 'type' => 'rich',
'title' => 'Hello World', 'title' => 'Hello World',
), ),
'https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://www.youtube.com/watch?v=72xdCU__XCk',
'<p>Foo</p><iframe title="Hello World" src=""></iframe><b>Bar</b>', '<p>Foo</p><iframe title="Hello World" src=""></iframe><b>Bar</b>',
), ),
array( array(
@ -55,7 +55,7 @@ class Tests_Filter_oEmbed_Iframe_Title_Attribute extends WP_UnitTestCase {
'type' => 'rich', 'type' => 'rich',
'title' => 'Bar', 'title' => 'Bar',
), ),
'https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://www.youtube.com/watch?v=72xdCU__XCk',
'<iframe title="Foo" src=""></iframe>', '<iframe title="Foo" src=""></iframe>',
), ),
); );
@ -79,7 +79,7 @@ class Tests_Filter_oEmbed_Iframe_Title_Attribute extends WP_UnitTestCase {
'type' => 'rich', 'type' => 'rich',
'title' => 'Bar', 'title' => 'Bar',
), ),
'https://www.youtube.com/watch?v=dQw4w9WgXcQ' 'https://www.youtube.com/watch?v=72xdCU__XCk'
); );
remove_filter( 'oembed_iframe_title_attribute', array( $this, '_filter_oembed_iframe_title_attribute' ) ); remove_filter( 'oembed_iframe_title_attribute', array( $this, '_filter_oembed_iframe_title_attribute' ) );
@ -96,7 +96,7 @@ class Tests_Filter_oEmbed_Iframe_Title_Attribute extends WP_UnitTestCase {
'type' => 'rich', 'type' => 'rich',
'title' => 'Bar', 'title' => 'Bar',
), ),
'https://www.youtube.com/watch?v=dQw4w9WgXcQ' 'https://www.youtube.com/watch?v=72xdCU__XCk'
); );
remove_filter( 'oembed_iframe_title_attribute', array( $this, '_filter_oembed_iframe_title_attribute' ) ); remove_filter( 'oembed_iframe_title_attribute', array( $this, '_filter_oembed_iframe_title_attribute' ) );

View File

@ -213,9 +213,9 @@ class Tests_Shortcode extends WP_UnitTestCase {
} }
function test_positional_atts_url() { function test_positional_atts_url() {
$out = do_shortcode( '[test-shortcode-tag http://www.youtube.com/watch?v=eBGIQ7ZuuiU]' ); $out = do_shortcode( '[test-shortcode-tag https://www.youtube.com/watch?v=72xdCU__XCk]' );
$this->assertSame( '', $out ); $this->assertSame( '', $out );
$this->assertSame( array( 0 => 'http://www.youtube.com/watch?v=eBGIQ7ZuuiU' ), $this->atts ); $this->assertSame( array( 0 => 'https://www.youtube.com/watch?v=72xdCU__XCk' ), $this->atts );
$this->assertSame( 'test-shortcode-tag', $this->tagname ); $this->assertSame( 'test-shortcode-tag', $this->tagname );
} }

View File

@ -286,7 +286,7 @@ class Test_WP_Widget_Media_Video extends WP_UnitTestCase {
array( array(
'attachment_id' => null, 'attachment_id' => null,
'loop' => false, 'loop' => false,
'url' => 'https://www.youtube.com/watch?v=OQSNhk5ICTI', 'url' => 'https://www.youtube.com/watch?v=72xdCU__XCk',
'content' => $content, 'content' => $content,
) )
); );
@ -294,7 +294,7 @@ class Test_WP_Widget_Media_Video extends WP_UnitTestCase {
// Custom attributes. // Custom attributes.
$this->assertContains( 'preload="metadata"', $output ); $this->assertContains( 'preload="metadata"', $output );
$this->assertContains( 'src="https://www.youtube.com/watch?v=OQSNhk5ICTI', $output ); $this->assertContains( 'src="https://www.youtube.com/watch?v=72xdCU__XCk', $output );
$this->assertContains( $content, $output ); $this->assertContains( $content, $output );
} }