Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Providers/OEmbed/Youtube.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
91 changes: 51 additions & 40 deletions tests/YoutubeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand Down