- π¬π§United Kingdom alexpott πͺπΊπ
It would be lovely to use a .env to set environment variables for testing. This would make it much simpler to swap between Drupal 10 and 11 for testing purposes.
I propose we add the Symfony dotenv library as a dependency and use it to load files from the root directory of the project. We could add
// loads .env, .env.local, and .env.$APP_ENV.local or .env.$APP_ENV $dotenv->loadEnv(__DIR__.'/.env');
to core/tests/bootstrap.php so environment variables are available when testing and we could add it to \Drupal\Core\DrupalKernel::bootEnvironment() to ensure it is loaded when we boot.
This would allow consist environment management for Drupal core dev and projects built on Drupal.