2019-04-22 19:52:21 +00:00
|
|
|
<?php
|
2019-10-03 19:24:12 +00:00
|
|
|
|
2019-04-22 19:52:21 +00:00
|
|
|
/**
|
|
|
|
* YoutubeStreamTest class.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Alltube\Test;
|
|
|
|
|
|
|
|
use Alltube\Stream\YoutubeStream;
|
|
|
|
use Alltube\Video;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unit tests for the YoutubeStream class.
|
2019-10-26 14:13:08 +00:00
|
|
|
* @requires download
|
2019-04-22 19:52:21 +00:00
|
|
|
*/
|
|
|
|
class YoutubeStreamTest extends StreamTest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Prepare tests.
|
|
|
|
*/
|
|
|
|
protected function setUp()
|
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$video = new Video('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '135');
|
|
|
|
|
|
|
|
$this->stream = new YoutubeStream($video);
|
|
|
|
}
|
2019-04-26 18:43:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test the getMetadata() function.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testGetMetadataWithKey()
|
|
|
|
{
|
|
|
|
$this->assertNull($this->stream->getMetadata('foo'));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test the detach() function.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testDetach()
|
|
|
|
{
|
|
|
|
$this->assertNull($this->stream->detach());
|
|
|
|
}
|
2019-04-22 19:52:21 +00:00
|
|
|
}
|