Krlinhos
1 week ago

Behat test not overwrite .env values

Posted 1 week ago by Krlinhos

Hello,

I have a project with a .env file and other .env.behat The problem is when I run the tests the values for variables are .env values instead of .env.behat I have realized that if I have a variable in .env.behat and not in .env this value is as expected, but if I have the variable in both files, the value always is from .env file

behat.yml:

default: 
    extensions: 
        Laracasts\Behat\ServiceContainer\BehatExtension: 
            env_path: .env.behat 
...

.env:

VARIABLE_ONE=A

.env.behat:

VARIABLE_ONE=B VARIABLE_TWO=C

when I run the test VARIABLE_ONE worths A instead of B, and VARIABLE_TWO worths C

Someone has some idea??

Thanks!

Please sign in or create an account to participate in this conversation.