Add support for password protected videos

This commit is contained in:
Pierre Rudloff 2016-10-20 23:01:31 +02:00
parent 621ccfb491
commit e34b01f2c4
9 changed files with 196 additions and 29 deletions

View file

@ -89,6 +89,38 @@ class VideoDownloadTest extends \PHPUnit_Framework_TestCase
$this->assertContains($domain, $videoURL);
}
/**
* Test getURL function with a protected video
*
* @return void
*/
public function testGetURLWithPassword()
{
$this->assertContains('vimeocdn.com', $this->download->getURL('http://vimeo.com/68375962', null, 'youtube-dl'));
}
/**
* Test getURL function with a protected video and no password.
*
* @return void
* @expectedException \Alltube\PasswordException
*/
public function testGetURLWithMissingPassword()
{
$this->download->getURL('http://vimeo.com/68375962');
}
/**
* Test getURL function with a protected video and a wrong password.
*
* @return void
* @expectedException Exception
*/
public function testGetURLWithWrongPassword()
{
$this->download->getURL('http://vimeo.com/68375962', null, 'foo');
}
/**
* Test getURL function errors.
*