44
55class YoutubeTest extends AbstractTestCase
66{
7-
87 static private $ expectedVideoInfo = [
98 'title ' => 'Noisy kittens waiting for dinner! ' ,
109 'imageWidth ' => 480 ,
@@ -14,7 +13,11 @@ class YoutubeTest extends AbstractTestCase
1413 'authorUrl ' => 'https://www.youtube.com/user/smshdchrb ' ,
1514 'providerName ' => 'YouTube ' ,
1615 'providerUrl ' => 'https://www.youtube.com/ ' ,
17- 'tags ' => [
16+ // `tags` are extracted by HTML provider from the page source, but
17+ // in countries with cookie consent laws a consent page is first
18+ // shown. The HTML provider tries to extract from the consent
19+ // page and fails. In other countries this should work.
20+ /*'tags' => [
1821 'kittens',
1922 'cats',
2023 'hungry',
@@ -43,22 +46,28 @@ class YoutubeTest extends AbstractTestCase
4346 'talking',
4447 'adorable',
4548 'climbing'
46- ],
49+ ],*/
4750 ];
48-
51+
4952 public function testOne ()
5053 {
5154 $ this ->assertEmbed (
52- 'http://www.youtube.com/watch?v=eiHXASgRTcA ' ,
53- self ::$ expectedVideoInfo
55+ $ url = 'http://www.youtube.com/watch?v=eiHXASgRTcA ' ,
56+ array_merge (
57+ self ::$ expectedVideoInfo ,
58+ ['url ' => $ url ]
59+ )
5460 );
5561 }
56-
62+
5763 public function testShareUrl ()
5864 {
5965 $ this ->assertEmbed (
60- 'http://youtu.be/eiHXASgRTcA ' ,
61- self ::$ expectedVideoInfo
66+ $ url = 'http://youtu.be/eiHXASgRTcA ' ,
67+ array_merge (
68+ self ::$ expectedVideoInfo ,
69+ ['url ' => $ url ]
70+ )
6271 );
6372 }
6473
@@ -71,7 +80,7 @@ public function testPlayList()
7180 'imageWidth ' => 480 ,
7281 'imageHeight ' => 360 ,
7382 'type ' => 'video ' ,
74- 'code ' => '<iframe width="480 " height="270 " src="https://www.youtube.com/embed/videoseries?list=PL4qTakKkQATKOyZPJG_cAMnRtF7fAIdST" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> ' ,
83+ 'code ' => '<iframe width="200 " height="113 " src="https://www.youtube.com/embed/videoseries?list=PL4qTakKkQATKOyZPJG_cAMnRtF7fAIdST" frameborder="0" allow="accelerometer; autoplay; clipboard-write ; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> ' ,
7584 'authorName ' => 'Scadrei5 ' ,
7685 ]
7786 );
0 commit comments