Make sure local config is not loaded in tests

This commit is contained in:
Alejandro Celaya 2023-09-12 08:21:34 +02:00
parent b17c576a30
commit a3b2f94339
2 changed files with 4 additions and 5 deletions

View File

@ -18,7 +18,7 @@
"ext-json": "*",
"ext-pdo": "*",
"akrabat/ip-address-middleware": "^2.1",
"cakephp/chronos": "^2.3",
"cakephp/chronos": "~2.3.3",
"doctrine/migrations": "^3.5",
"doctrine/orm": "^2.14",
"endroid/qr-code": "^4.7",

View File

@ -42,10 +42,9 @@ return (new ConfigAggregator\ConfigAggregator([
Core\ConfigProvider::class,
CLI\ConfigProvider::class,
Rest\ConfigProvider::class,
new ConfigAggregator\PhpFileProvider('config/autoload/{{,*.}global,{,*.}local}.php'),
$isTestEnv
? new ConfigAggregator\PhpFileProvider('config/test/*.global.php')
: new ConfigAggregator\ArrayProvider([]),
new ConfigAggregator\PhpFileProvider('config/autoload/{,*.}global.php'),
// Local config should not be loaded during tests, whereas test config should be loaded ONLY during tests
new ConfigAggregator\PhpFileProvider($isTestEnv ? 'config/test/*.global.php' : 'config/autoload/{,*.}local.php'),
// Routes have to be loaded last
new ConfigAggregator\PhpFileProvider('config/autoload/routes.config.php'),
], 'data/cache/app_config.php', [