Fixed ConfigServiceProviderTest when no config file has been created
This commit is contained in:
parent
a0cdd522da
commit
a7d2bcf88b
|
@ -29,7 +29,17 @@ class ConfigServiceProviderTest extends ServiceProviderTest
|
||||||
$this->setExpects($config, 'set', null, null, $this->exactly(2));
|
$this->setExpects($config, 'set', null, null, $this->exactly(2));
|
||||||
$this->setExpects($config, 'get', [null], []);
|
$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 = new ConfigServiceProvider($app);
|
||||||
$serviceProvider->register();
|
$serviceProvider->register();
|
||||||
|
|
||||||
|
if (!$configExists) {
|
||||||
|
unlink($configFile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue