Skip to content
Permalink
Browse files

Merge pull request #305 from kmcs/master

Allow YouTube share url
  • Loading branch information...
oscarotero committed Mar 7, 2019
2 parents 4f0d7c0 + 4ef2c13 commit 9055d16ff639c76f318b9899dcadbf40ded4026a
Showing with 52 additions and 41 deletions.
  1. +1 −1 src/Providers/OEmbed/Youtube.php
  2. +51 −40 tests/YoutubeTest.php
@@ -4,6 +4,6 @@
class Youtube extends EndPoint implements EndPointInterface
{
protected static $pattern = '*youtube.*';
protected static $pattern = ['*youtube.*', '*youtu\.be.*'];
protected static $endPoint = 'http://www.youtube.com/oembed';
}
@@ -4,50 +4,61 @@
class YoutubeTest extends AbstractTestCase
{
static private $expectedVideoInfo = [
'title' => 'Noisy kittens waiting for dinner!',
'imageWidth' => 480,
'imageHeight' => 360,
'type' => 'video',
'authorName' => 'smshdchrb',
'authorUrl' => 'https://www.youtube.com/user/smshdchrb',
'providerName' => 'YouTube',
'providerUrl' => 'https://www.youtube.com/',
'tags' => [
'kittens',
'cats',
'hungry',
'cat',
'baby',
'eight',
'weeks',
'old',
'noisy',
'meow',
'funny',
'kitties',
'feline',
'dinner',
'excited',
'loud',
'cute',
'pet',
'food',
'time',
'felix',
'kitty',
'catz',
'lolcat',
'kitten',
'talking',
'adorable',
'climbing'
],
];
public function testOne()
{
$this->assertEmbed(
'http://www.youtube.com/watch?v=eiHXASgRTcA',
[
'title' => 'Noisy kittens waiting for dinner!',
'imageWidth' => 480,
'imageHeight' => 360,
'type' => 'video',
'authorName' => 'smshdchrb',
'authorUrl' => 'https://www.youtube.com/user/smshdchrb',
'providerName' => 'YouTube',
'providerUrl' => 'https://www.youtube.com/',
'tags' => [
'kittens',
'cats',
'hungry',
'cat',
'baby',
'eight',
'weeks',
'old',
'noisy',
'meow',
'funny',
'kitties',
'feline',
'dinner',
'excited',
'loud',
'cute',
'pet',
'food',
'time',
'felix',
'kitty',
'catz',
'lolcat',
'kitten',
'talking',
'adorable',
'climbing'
],
]
self::$expectedVideoInfo
);
}
public function testShareUrl()
{
$this->assertEmbed(
'http://youtu.be/eiHXASgRTcA',
self::$expectedVideoInfo
);
}

0 comments on commit 9055d16

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.