Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

.env file always overiding environment variables when used in params #6923

Copy link
Copy link

Description

@GameBurrow
Issue body actions

I've stumbled upon a bug reported here:
#6473

If configure my codeception.yml like this

params:
    - .env # load params from .env file
    - env # load params from environment vars

and a value comes both from .env file and ENV variable then the .env value is always used (no matter in which order you load the params).

In the original ticket the issue was fixed in #6477 however only SymfonyDotenv section was changed, could it be that the bug is still in if using PhpDotenv?

if (
class_exists(PhpDotenv::class) &&
class_exists(RepositoryBuilder::class) &&
method_exists(RepositoryBuilder::class, 'createWithDefaultAdapters')
) {
$repository = RepositoryBuilder::createWithDefaultAdapters()->make();
$dotenv = PhpDotenv::create($repository, codecept_root_dir(), codecept_relative_path($file));
return $dotenv->load();
}

Using verions 5.2.2 at the moment:

> php vendor/bin/codecept --version
Codeception 5.2.2
Reactions are currently unavailable

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.