Add some missing tests

This commit is contained in:
Pierre Rudloff 2016-12-26 14:04:18 +01:00
parent 60a393c579
commit c490a3f092

View file

@ -27,6 +27,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
$this->config = Config::getInstance('config_test.yml'); $this->config = Config::getInstance('config_test.yml');
} }
protected function tearDown()
{
Config::destroyInstance();
}
/** /**
* Test the getInstance function. * Test the getInstance function.
* *
@ -55,15 +60,19 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* Test the getInstance function with the CONVERT environment variable. * Test the getInstance function with the CONVERT and PYTHON environment variables.
* *
* @return void * @return void
*/ */
public function testGetInstanceWithEnv() public function testGetInstanceWithEnv()
{ {
putenv('CONVERT=1');
Config::destroyInstance(); Config::destroyInstance();
putenv('CONVERT=1');
putenv('PYTHON=foo');
$config = Config::getInstance('config_test.yml'); $config = Config::getInstance('config_test.yml');
$this->assertEquals($config->convert, true); $this->assertEquals($config->convert, true);
$this->assertEquals($config->python, 'foo');
putenv('CONVERT');
putenv('PYTHON');
} }
} }