Stop using a singleton for Config (#298)

This commit is contained in:
Pierre Rudloff 2020-10-17 22:07:07 +02:00
parent 6fc294afbe
commit 7e2afd8221
14 changed files with 87 additions and 169 deletions

View file

@ -48,7 +48,8 @@ class VideoTest extends BaseTest
{
parent::setUp();
$config = Config::getInstance();
// So ffmpeg does not spam the output with broken pipe errors.
$config = new Config(['ffmpegVerbosity' => 'fatal']);
$this->downloader = $config->getDownloader();
$this->format = 'best';
}
@ -352,8 +353,7 @@ class VideoTest extends BaseTest
public function testGetAudioStreamFfmpegError(string $url, string $format)
{
$this->expectException(AvconvException::class);
Config::setOptions(['ffmpeg' => 'foobar']);
$config = Config::getInstance();
$config = new Config(['ffmpeg' => 'foobar']);
$downloader = $config->getDownloader();
$video = new Video($this->downloader, $url, $format, $this->format);
@ -502,8 +502,7 @@ class VideoTest extends BaseTest
public function testGetM3uStreamFfmpegError(string $url, string $format)
{
$this->expectException(AvconvException::class);
Config::setOptions(['ffmpeg' => 'foobar']);
$config = Config::getInstance();
$config = new Config(['ffmpeg' => 'foobar']);
$downloader = $config->getDownloader();
$video = new Video($downloader, $url, $format);