Skip to content

Commit

Permalink
Fix typo (#144)
Browse files Browse the repository at this point in the history
* Update YoutubeTest.php

* Update Youtube.php
  • Loading branch information
alaouy authored Mar 29, 2020
1 parent 69b52d7 commit 2147f8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Youtube.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public function getRelatedVideos($videoId, $maxResults = 5, $part = ['id', 'snip
* @throws \Exception
* @return string Video Id
*/
public static function parseVIdFromURL($youtube_url)
public static function parseVidFromURL($youtube_url)
{
if (strpos($youtube_url, 'youtube.com')) {
if (strpos($youtube_url, 'embed')) {
Expand Down
10 changes: 5 additions & 5 deletions tests/YoutubeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,19 +278,19 @@ public function testGetPlaylistItemsByPlaylistId()

public function testParseVIdFromURLFull()
{
$vId = $this->youtube->parseVIdFromURL('http://www.youtube.com/watch?v=1FJHYqE0RDg');
$vId = $this->youtube->parseVidFromURL('http://www.youtube.com/watch?v=1FJHYqE0RDg');
$this->assertEquals('1FJHYqE0RDg', $vId);
}

public function testParseVIdFromURLShort()
{
$vId = $this->youtube->parseVIdFromURL('http://youtu.be/1FJHYqE0RDg');
$vId = $this->youtube->parseVidFromURL('http://youtu.be/1FJHYqE0RDg');
$this->assertEquals('1FJHYqE0RDg', $vId);
}

public function testParseVIdFromEmbedURL()
{
$vId = $this->youtube->parseVIdFromURL('http://youtube.com/embed/1FJHYqE0RDg');
$vId = $this->youtube->parseVidFromURL('http://youtube.com/embed/1FJHYqE0RDg');
$this->assertEquals('1FJHYqE0RDg', $vId);
}

Expand All @@ -300,15 +300,15 @@ public function testParseVIdFromEmbedURL()
*/
public function testParseVIdFromURLException($url)
{
$vId = $this->youtube->parseVIdFromURL($url);
$vId = $this->youtube->parseVidFromURL($url);
}

/**
* @expectedException \Exception
*/
public function testParseVIdException()
{
$vId = $this->youtube->parseVIdFromURL('http://www.facebook.com');
$vId = $this->youtube->parseVidFromURL('http://www.facebook.com');
}

public function testGetActivitiesByChannelId()
Expand Down

0 comments on commit 2147f8b

Please sign in to comment.