X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fconfig%2FConfigPhpTest.php;h=7bf9fe64933925d23c4f96362894c512ea918997;hb=7b18876361f2223672f3a2cac9fc0da16d12d69f;hp=abfbb30538f7f27b06468a3be6887a0ebe1f3de1;hpb=3c66e56435359dc678048193e8ee239d06f79b64;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/config/ConfigPhpTest.php b/tests/config/ConfigPhpTest.php index abfbb305..7bf9fe64 100644 --- a/tests/config/ConfigPhpTest.php +++ b/tests/config/ConfigPhpTest.php @@ -3,15 +3,19 @@ namespace Shaarli\Config; /** * Class ConfigPhpTest + * + * We run tests in separate processes due to the usage for $GLOBALS + * which are kept between tests. + * @runTestsInSeparateProcesses */ -class ConfigPhpTest extends \PHPUnit_Framework_TestCase +class ConfigPhpTest extends \Shaarli\TestCase { /** * @var ConfigPhp */ protected $configIO; - public function setUp() + protected function setUp(): void { $this->configIO = new ConfigPhp(); } @@ -36,6 +40,20 @@ class ConfigPhpTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array(), $this->configIO->read('nope')); } + /** + * Read an empty existent config file -> array with blank default values. + */ + public function testReadEmpty() + { + $dataFile = 'tests/utils/config/emptyConfigPhp.php'; + $conf = $this->configIO->read($dataFile); + $this->assertEmpty($conf['login']); + $this->assertEmpty($conf['title']); + $this->assertEmpty($conf['titleLink']); + $this->assertEmpty($conf['config']); + $this->assertEmpty($conf['plugins']); + } + /** * Write a new config file. */