diff --git a/tests/Application/bin/console b/tests/Application/bin/console index c0fb647c..2a2ef58b 100755 --- a/tests/Application/bin/console +++ b/tests/Application/bin/console @@ -21,7 +21,9 @@ if (!isset($_SERVER['APP_ENV'])) { if (!class_exists(Dotenv::class)) { throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'); } - (new Dotenv())->load(__DIR__.'/../.env'); + + $envFile = file_exists(__DIR__.'/../.env') ? __DIR__.'/../.env' : __DIR__.'/../.env.dist'; + (new Dotenv())->load($envFile); } $input = new ArgvInput(); diff --git a/tests/Application/public/index.php b/tests/Application/public/index.php index c836084a..879052d0 100644 --- a/tests/Application/public/index.php +++ b/tests/Application/public/index.php @@ -14,7 +14,9 @@ if (!class_exists(Dotenv::class)) { throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'); } - (new Dotenv())->load(__DIR__.'/../.env'); + + $envFile = file_exists(__DIR__.'/../.env') ? __DIR__.'/../.env' : __DIR__.'/../.env.dist'; + (new Dotenv())->load($envFile); } $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';