alltube/tests/YoutubeStreamTest.php

52 lines
909 B
PHP
Raw Normal View History

<?php
/**
* YoutubeStreamTest class.
*/
namespace Alltube\Test;
use Alltube\Stream\YoutubeStream;
use Alltube\Video;
2020-05-13 21:33:05 +02:00
use Exception;
/**
* Unit tests for the YoutubeStream class.
* @requires download
*/
class YoutubeStreamTest extends StreamTest
{
/**
* Prepare tests.
2020-05-13 21:33:05 +02:00
* @throws Exception
*/
2019-11-30 14:08:18 +01:00
protected function setUp(): void
{
parent::setUp();
$video = new Video('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '135');
$this->stream = new YoutubeStream($video);
}
2019-04-26 20:43:01 +02: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());
}
}