Skip to content

Confusing default bootstrapping for "test" env #574

@phansys

Description

@phansys

Given the changes made at #491, using config/bootstrap.php as bootstrap of phpunit is not possible if .env.local.php exists without variables that closely belongs to the "test" env ("KERNEL_CLASS", "SYMFONY_DEPRECATIONS_HELPER", etc); since the file from where these variables should be loaded (.env.test) isn't required at all:

KERNEL_CLASS='App\Kernel'
APP_SECRET='s$cretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999

Since these variables are not common for the local environment, the dumped array at .env.local.php doesn't contains them, making the test suite unusable without changes:

if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) {
$_ENV += $env;
} elseif (!class_exists(Dotenv::class)) {
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
} else {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions