Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.env.behat is read but variables aren't accessible #79

Open
ebrahimdunro opened this issue Jun 3, 2018 · 1 comment
Open

.env.behat is read but variables aren't accessible #79

ebrahimdunro opened this issue Jun 3, 2018 · 1 comment

Comments

@ebrahimdunro
Copy link

My laravel version = 5.4
and my composer.json:
`"barryvdh/laravel-ide-helper": "^2.3",

    "behat/behat": "^3.4",

    "behat/mink": "^1.7",

    "behat/mink-extension": "^2.3",

    "fzaninotto/faker": "~1.4",

    "laracasts/behat-laravel-extension": "^1.1",`

I removed APP_ENV from .env and set APP_ENV=behat in .env.behat
When I echo environment:
echo app()->environment() ----> local
And environment variables can not be used by env() and this method always returns null for everything.
But! If I echo loaded env file:
echo app()->environmentFile() ---> .env.behat

What should I do?

@ebrahimdunro ebrahimdunro changed the title .env.behat is read but variables aren't accessable .env.behat is read but variables aren't accessible Jun 3, 2018
@ebrahimdunro
Copy link
Author

ebrahimdunro commented Jun 3, 2018

and my behat.yml

`default:

suites:

something:

  paths:

    - %paths.base%/tests/Features/Something

  contexts:

    - Tests\Features\Something\Contexts\SomethingContext

extensions:

Laracasts\Behat:

  env_path: .env.behat`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant