4
4
5
5
class YoutubeTest extends AbstractTestCase
6
6
{
7
-
8
7
static private $ expectedVideoInfo = [
9
8
'title ' => 'Noisy kittens waiting for dinner! ' ,
10
9
'imageWidth ' => 480 ,
@@ -14,7 +13,11 @@ class YoutubeTest extends AbstractTestCase
14
13
'authorUrl ' => 'https://www.youtube.com/user/smshdchrb ' ,
15
14
'providerName ' => 'YouTube ' ,
16
15
'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' => [
18
21
'kittens',
19
22
'cats',
20
23
'hungry',
@@ -43,22 +46,28 @@ class YoutubeTest extends AbstractTestCase
43
46
'talking',
44
47
'adorable',
45
48
'climbing'
46
- ],
49
+ ],*/
47
50
];
48
-
51
+
49
52
public function testOne ()
50
53
{
51
54
$ 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
+ )
54
60
);
55
61
}
56
-
62
+
57
63
public function testShareUrl ()
58
64
{
59
65
$ 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
+ )
62
71
);
63
72
}
64
73
@@ -71,7 +80,7 @@ public function testPlayList()
71
80
'imageWidth ' => 480 ,
72
81
'imageHeight ' => 360 ,
73
82
'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> ' ,
75
84
'authorName ' => 'Scadrei5 ' ,
76
85
]
77
86
);
0 commit comments