diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2017-10-31 15:13:37 +0100 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-10-31 15:13:37 +0100 |
commit | a7d2bcf88b855af7fb101f2388f9f4a3d2cf0281 (patch) | |
tree | 56c0d1b7a10afd5e3e083d72044932862fe8e1d5 /tests/Unit | |
parent | a0cdd522dad14b619fdff2bba5dd43d7b32c5893 (diff) |
Fixed ConfigServiceProviderTest when no config file has been created
Diffstat (limited to 'tests/Unit')
-rw-r--r-- | tests/Unit/Config/ConfigServiceProviderTest.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/Unit/Config/ConfigServiceProviderTest.php b/tests/Unit/Config/ConfigServiceProviderTest.php index ab6fa67f..c8be4b7d 100644 --- a/tests/Unit/Config/ConfigServiceProviderTest.php +++ b/tests/Unit/Config/ConfigServiceProviderTest.php @@ -29,7 +29,17 @@ class ConfigServiceProviderTest extends ServiceProviderTest $this->setExpects($config, 'set', null, null, $this->exactly(2)); $this->setExpects($config, 'get', [null], []); + $configFile = __DIR__ . '/../../../config/config.php'; + $configExists = file_exists($configFile); + if (!$configExists) { + file_put_contents($configFile, '<?php return [];'); + } + $serviceProvider = new ConfigServiceProvider($app); $serviceProvider->register(); + + if (!$configExists) { + unlink($configFile); + } } } |