File tree Expand file tree Collapse file tree 2 files changed +52
-41
lines changed Expand file tree Collapse file tree 2 files changed +52
-41
lines changed Original file line number Diff line number Diff line change 4
4
5
5
class Youtube extends EndPoint implements EndPointInterface
6
6
{
7
- protected static $ pattern = '*youtube.* ' ;
7
+ protected static $ pattern = [ '*youtube.* ' , ' *youtu\.be.* ' ] ;
8
8
protected static $ endPoint = 'http://www.youtube.com/oembed ' ;
9
9
}
Original file line number Diff line number Diff line change 4
4
5
5
class YoutubeTest extends AbstractTestCase
6
6
{
7
+
8
+ static private $ expectedVideoInfo = [
9
+ 'title ' => 'Noisy kittens waiting for dinner! ' ,
10
+ 'imageWidth ' => 480 ,
11
+ 'imageHeight ' => 360 ,
12
+ 'type ' => 'video ' ,
13
+ 'authorName ' => 'smshdchrb ' ,
14
+ 'authorUrl ' => 'https://www.youtube.com/user/smshdchrb ' ,
15
+ 'providerName ' => 'YouTube ' ,
16
+ 'providerUrl ' => 'https://www.youtube.com/ ' ,
17
+ 'tags ' => [
18
+ 'kittens ' ,
19
+ 'cats ' ,
20
+ 'hungry ' ,
21
+ 'cat ' ,
22
+ 'baby ' ,
23
+ 'eight ' ,
24
+ 'weeks ' ,
25
+ 'old ' ,
26
+ 'noisy ' ,
27
+ 'meow ' ,
28
+ 'funny ' ,
29
+ 'kitties ' ,
30
+ 'feline ' ,
31
+ 'dinner ' ,
32
+ 'excited ' ,
33
+ 'loud ' ,
34
+ 'cute ' ,
35
+ 'pet ' ,
36
+ 'food ' ,
37
+ 'time ' ,
38
+ 'felix ' ,
39
+ 'kitty ' ,
40
+ 'catz ' ,
41
+ 'lolcat ' ,
42
+ 'kitten ' ,
43
+ 'talking ' ,
44
+ 'adorable ' ,
45
+ 'climbing '
46
+ ],
47
+ ];
48
+
7
49
public function testOne ()
8
50
{
9
51
$ this ->assertEmbed (
10
52
'http://www.youtube.com/watch?v=eiHXASgRTcA ' ,
11
- [
12
- 'title ' => 'Noisy kittens waiting for dinner! ' ,
13
- 'imageWidth ' => 480 ,
14
- 'imageHeight ' => 360 ,
15
- 'type ' => 'video ' ,
16
- 'authorName ' => 'smshdchrb ' ,
17
- 'authorUrl ' => 'https://www.youtube.com/user/smshdchrb ' ,
18
- 'providerName ' => 'YouTube ' ,
19
- 'providerUrl ' => 'https://www.youtube.com/ ' ,
20
- 'tags ' => [
21
- 'kittens ' ,
22
- 'cats ' ,
23
- 'hungry ' ,
24
- 'cat ' ,
25
- 'baby ' ,
26
- 'eight ' ,
27
- 'weeks ' ,
28
- 'old ' ,
29
- 'noisy ' ,
30
- 'meow ' ,
31
- 'funny ' ,
32
- 'kitties ' ,
33
- 'feline ' ,
34
- 'dinner ' ,
35
- 'excited ' ,
36
- 'loud ' ,
37
- 'cute ' ,
38
- 'pet ' ,
39
- 'food ' ,
40
- 'time ' ,
41
- 'felix ' ,
42
- 'kitty ' ,
43
- 'catz ' ,
44
- 'lolcat ' ,
45
- 'kitten ' ,
46
- 'talking ' ,
47
- 'adorable ' ,
48
- 'climbing '
49
- ],
50
- ]
53
+ self ::$ expectedVideoInfo
54
+ );
55
+ }
56
+
57
+ public function testShareUrl ()
58
+ {
59
+ $ this ->assertEmbed (
60
+ 'http://youtu.be/eiHXASgRTcA ' ,
61
+ self ::$ expectedVideoInfo
51
62
);
52
63
}
53
64
You can’t perform that action at this time.
0 commit comments