laracasts / Behat-Laravel-Extension

Laravel extension for Behat functional testing.
MIT License
260 stars 73 forks source link

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

Open ebrahimdunro opened 6 years ago

ebrahimdunro commented 6 years ago

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 commented 6 years ago

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`