How can I retrieve my environment variables in a parameter file in Symfony4 structure?

后端 未结 2 1208
失恋的感觉
失恋的感觉 2021-01-11 18:03

I did a fresh Symfony installation by using Symfony Flex and the new skeleton belong to the next Symfony 4 directory structure.

I add and configure a first third-pa

2条回答
  •  孤街浪徒
    2021-01-11 18:24

    For test environments I'd suggest also create a bootstrap.php script to override the .env parameters:

    tests/bootstrap.php:

    load(__DIR__.'/../.env');
    $dotEnv->populate([
        'APP_ENV' => 'test',
        'DATABASE_URL' => '...'
        // ...
    ]);
    

    phpunit.xml.dist:

    
    
    
        ...
    
    

提交回复
热议问题