Merge branch 'release-2.0.1'

This commit is contained in:
Pierre Rudloff 2019-04-28 16:06:00 +02:00
commit a0811c6dc4
4 changed files with 18 additions and 4 deletions

View file

@ -135,7 +135,6 @@ class Config
{ {
$this->applyOptions($options); $this->applyOptions($options);
$this->getEnv(); $this->getEnv();
$this->validateOptions();
} }
/** /**
@ -216,6 +215,7 @@ class Config
if (is_file($file)) { if (is_file($file)) {
$options = Yaml::parse(file_get_contents($file)); $options = Yaml::parse(file_get_contents($file));
self::$instance = new self($options); self::$instance = new self($options);
self::$instance->validateOptions();
} else { } else {
throw new Exception("Can't find config file at ".$file); throw new Exception("Can't find config file at ".$file);
} }

View file

@ -60,11 +60,11 @@ class YoutubeChunkStream implements StreamInterface
/** /**
* Closes the stream and any underlying resources. * Closes the stream and any underlying resources.
* *
* @return mixed * @return void
*/ */
public function close() public function close()
{ {
return $this->response->getBody()->close(); $this->response->getBody()->close();
} }
/** /**

View file

@ -1,7 +1,7 @@
{ {
"name": "alltube", "name": "alltube",
"description": "HTML GUI for youtube-dl", "description": "HTML GUI for youtube-dl",
"version": "2.0.0", "version": "2.0.1",
"author": "Pierre Rudloff", "author": "Pierre Rudloff",
"bugs": "https://github.com/Rudloff/alltube/issues", "bugs": "https://github.com/Rudloff/alltube/issues",
"dependencies": { "dependencies": {

View file

@ -41,6 +41,20 @@ class ConfigTest extends BaseTest
$this->assertConfig($config); $this->assertConfig($config);
} }
/**
* Test the getInstance function.
*
* @return void
*/
public function testGetInstanceFromScratch()
{
Config::destroyInstance();
$config = Config::getInstance();
$this->assertEquals($config->convert, false);
$this->assertConfig($config);
}
/** /**
* Assert that a Config object is correctly instantiated. * Assert that a Config object is correctly instantiated.
* *