Ticket #51487: 51487.diff
File 51487.diff, 10.7 KB (added by , 4 years ago) |
---|
-
tests/phpunit/tests/customize/manager.php
3613 3613 function test_sanitize_external_header_video_trim() { 3614 3614 $this->manager->register_controls(); 3615 3615 $setting = $this->manager->get_setting( 'external_header_video' ); 3616 $video_url = 'https://www.youtube.com/watch?v= KiS8rZBeIO0';3616 $video_url = 'https://www.youtube.com/watch?v=72xdCU__XCk'; 3617 3617 3618 3618 $whitespaces = array( 3619 3619 ' ', // Space. -
tests/phpunit/tests/formatting/MakeClickable.php
289 289 "http://trunk.domain/testing#something (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)", 290 290 "http://trunk.domain/testing#something 291 291 (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)", 292 "<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>",292 "<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>", 293 293 '<a href="http://example.com/example.gif" title="Image from http://example.com">Look at this image!</a>', 294 294 ); 295 295 $urls_expected = array( … … 298 298 "<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'>)", 299 299 "<a href=\"http://trunk.domain/testing#something\" rel=\"nofollow\">http://trunk.domain/testing#something</a> 300 300 (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)", 301 "<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>",301 "<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>", 302 302 '<a href="http://example.com/example.gif" title="Image from http://example.com">Look at this image!</a>', 303 303 ); 304 304 foreach ( $urls_before as $key => $url ) { -
tests/phpunit/tests/media.php
934 934 function test_wp_video_shortcode_youtube_remove_feature() { 935 935 $actual = wp_video_shortcode( 936 936 array( 937 'src' => 'https://www.youtube.com/watch?v= i_cVJgIz_Cs&feature=youtu.be',937 'src' => 'https://www.youtube.com/watch?v=72xdCU__XCk&feature=youtu.be', 938 938 ) 939 939 ); 940 940 … … 948 948 function test_wp_video_shortcode_youtube_force_ssl() { 949 949 $actual = wp_video_shortcode( 950 950 array( 951 'src' => 'http://www.youtube.com/watch?v= i_cVJgIz_Cs',951 'src' => 'http://www.youtube.com/watch?v=72xdCU__XCk', 952 952 ) 953 953 ); 954 954 955 $this->assertContains( 'src="https://www.youtube.com/watch?v= i_cVJgIz_Cs', $actual );955 $this->assertContains( 'src="https://www.youtube.com/watch?v=72xdCU__XCk', $actual ); 956 956 } 957 957 958 958 /** … … 962 962 function test_wp_video_shortcode_vimeo_force_ssl_remove_query_args() { 963 963 $actual = wp_video_shortcode( 964 964 array( 965 'src' => 'http://vimeo.com/ 190372437?blah=meh',965 'src' => 'http://vimeo.com/76979871?blah=meh', 966 966 ) 967 967 ); 968 968 969 $this->assertContains( 'src="https://vimeo.com/ 190372437', $actual );969 $this->assertContains( 'src="https://vimeo.com/76979871', $actual ); 970 970 $this->assertNotContains( 'blah=meh', $actual ); 971 971 } 972 972 … … 977 977 function test_wp_video_shortcode_vimeo_adds_loop() { 978 978 $actual = wp_video_shortcode( 979 979 array( 980 'src' => 'http://vimeo.com/ 190372437',980 'src' => 'http://vimeo.com/76979871', 981 981 ) 982 982 ); 983 983 984 $this->assertContains( 'src="https://vimeo.com/ 190372437?loop=0', $actual );984 $this->assertContains( 'src="https://vimeo.com/76979871?loop=0', $actual ); 985 985 } 986 986 987 987 /** … … 991 991 function test_wp_video_shortcode_vimeo_force_adds_loop_true() { 992 992 $actual = wp_video_shortcode( 993 993 array( 994 'src' => 'http://vimeo.com/ 190372437',994 'src' => 'http://vimeo.com/76979871', 995 995 'loop' => true, 996 996 ) 997 997 ); 998 998 999 $this->assertContains( 'src="https://vimeo.com/ 190372437?loop=1', $actual );999 $this->assertContains( 'src="https://vimeo.com/76979871?loop=1', $actual ); 1000 1000 } 1001 1001 1002 1002 /** -
tests/phpunit/tests/oembed/filterResult.php
7 7 function test_filter_oembed_result_trusted_malicious_iframe() { 8 8 $html = '<p></p><iframe onload="alert(1)"></iframe>'; 9 9 10 $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), 'https://www.youtube.com/watch?v= dQw4w9WgXcQ' );10 $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), 'https://www.youtube.com/watch?v=72xdCU__XCk' ); 11 11 12 12 $this->assertSame( $html, $actual ); 13 13 } -
tests/phpunit/tests/oembed/filterTitleAttributes.php
11 11 array( 12 12 'type' => 'rich', 13 13 ), 14 'https://www.youtube.com/watch?v= dQw4w9WgXcQ',14 'https://www.youtube.com/watch?v=72xdCU__XCk', 15 15 '<p>Foo</p><iframe src=""></iframe><b>Bar</b>', 16 16 ), 17 17 array( … … 19 19 array( 20 20 'type' => 'rich', 21 21 ), 22 'https://www.youtube.com/watch?v= dQw4w9WgXcQ',22 'https://www.youtube.com/watch?v=72xdCU__XCk', 23 23 '<p>Foo</p><iframe title="Hello World" src=""></iframe><b>Bar</b>', 24 24 ), 25 25 array( … … 28 28 'type' => 'rich', 29 29 'title' => 'Hello World', 30 30 ), 31 'https://www.youtube.com/watch?v= dQw4w9WgXcQ',31 'https://www.youtube.com/watch?v=72xdCU__XCk', 32 32 '<p>Foo</p>', 33 33 ), 34 34 array( … … 37 37 'type' => 'rich', 38 38 'title' => 'Hello World', 39 39 ), 40 'https://www.youtube.com/watch?v= dQw4w9WgXcQ',40 'https://www.youtube.com/watch?v=72xdCU__XCk', 41 41 '<p title="Foo">Bar</p>', 42 42 ), 43 43 array( … … 46 46 'type' => 'rich', 47 47 'title' => 'Hello World', 48 48 ), 49 'https://www.youtube.com/watch?v= dQw4w9WgXcQ',49 'https://www.youtube.com/watch?v=72xdCU__XCk', 50 50 '<p>Foo</p><iframe title="Hello World" src=""></iframe><b>Bar</b>', 51 51 ), 52 52 array( … … 55 55 'type' => 'rich', 56 56 'title' => 'Bar', 57 57 ), 58 'https://www.youtube.com/watch?v= dQw4w9WgXcQ',58 'https://www.youtube.com/watch?v=72xdCU__XCk', 59 59 '<iframe title="Foo" src=""></iframe>', 60 60 ), 61 61 ); … … 79 79 'type' => 'rich', 80 80 'title' => 'Bar', 81 81 ), 82 'https://www.youtube.com/watch?v= dQw4w9WgXcQ'82 'https://www.youtube.com/watch?v=72xdCU__XCk' 83 83 ); 84 84 85 85 remove_filter( 'oembed_iframe_title_attribute', array( $this, '_filter_oembed_iframe_title_attribute' ) ); … … 96 96 'type' => 'rich', 97 97 'title' => 'Bar', 98 98 ), 99 'https://www.youtube.com/watch?v= dQw4w9WgXcQ'99 'https://www.youtube.com/watch?v=72xdCU__XCk' 100 100 ); 101 101 102 102 remove_filter( 'oembed_iframe_title_attribute', array( $this, '_filter_oembed_iframe_title_attribute' ) ); -
tests/phpunit/tests/shortcode.php
213 213 } 214 214 215 215 function test_positional_atts_url() { 216 $out = do_shortcode( '[test-shortcode-tag http ://www.youtube.com/watch?v=eBGIQ7ZuuiU]' );216 $out = do_shortcode( '[test-shortcode-tag https://www.youtube.com/watch?v=72xdCU__XCk]' ); 217 217 $this->assertSame( '', $out ); 218 $this->assertSame( array( 0 => 'http ://www.youtube.com/watch?v=eBGIQ7ZuuiU' ), $this->atts );218 $this->assertSame( array( 0 => 'https://www.youtube.com/watch?v=72xdCU__XCk' ), $this->atts ); 219 219 $this->assertSame( 'test-shortcode-tag', $this->tagname ); 220 220 } 221 221 -
tests/phpunit/tests/widgets/media-video-widget.php
286 286 array( 287 287 'attachment_id' => null, 288 288 'loop' => false, 289 'url' => 'https://www.youtube.com/watch?v= OQSNhk5ICTI',289 'url' => 'https://www.youtube.com/watch?v=72xdCU__XCk', 290 290 'content' => $content, 291 291 ) 292 292 ); … … 294 294 295 295 // Custom attributes. 296 296 $this->assertContains( 'preload="metadata"', $output ); 297 $this->assertContains( 'src="https://www.youtube.com/watch?v= OQSNhk5ICTI', $output );297 $this->assertContains( 'src="https://www.youtube.com/watch?v=72xdCU__XCk', $output ); 298 298 $this->assertContains( $content, $output ); 299 299 } 300 300