From c994f8ac9afae1ca22683b2eade69f0ce5525b89 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 11:47:23 +0100 Subject: [PATCH] Add missing assertions to testGetInstanceWithEmptyFile --- tests/ConfigTest.php | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 37e7419..2ecb6a0 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -46,11 +46,27 @@ class ConfigTest extends TestCase public function testGetInstance() { $this->assertEquals($this->config->convert, false); - $this->assertInternalType('array', $this->config->params); - $this->assertInternalType('string', $this->config->youtubedl); - $this->assertInternalType('string', $this->config->python); - $this->assertInternalType('string', $this->config->avconv); - $this->assertInternalType('string', $this->config->rtmpdump); + $this->assertConfig($this->config); + } + + /** + * Assert that a Config object is correctly instantiated. + * + * @param Config $config Config class instance. + * + * @return void + */ + private function assertConfig(Config $config) + { + $this->assertInternalType('array', $config->params); + $this->assertInternalType('string', $config->youtubedl); + $this->assertInternalType('string', $config->python); + $this->assertInternalType('string', $config->avconv); + $this->assertInternalType('string', $config->rtmpdump); + $this->assertInternalType('bool', $config->convert); + $this->assertInternalType('bool', $config->uglyUrls); + $this->assertInternalType('bool', $config->stream); + $this->assertInternalType('bool', $config->remux); } /** @@ -65,13 +81,14 @@ class ConfigTest extends TestCase } /** - * Test the getInstance function with aen empty filename. + * Test the getInstance function with an empty filename. * * @return void */ public function testGetInstanceWithEmptyFile() { - Config::getInstance(''); + $config = Config::getInstance(''); + $this->assertConfig($config); } /**