Skip to content

Instantly share code, notes, and snippets.

@richardtape
Created September 2, 2016 00:36
Show Gist options
  • Save richardtape/46b38590d04b04f03aa690f52d9a5853 to your computer and use it in GitHub Desktop.
Save richardtape/46b38590d04b04f03aa690f52d9a5853 to your computer and use it in GitHub Desktop.
Behat 3 imports
imports:
- config/ctlt-events-config.yml
default:
suites:
default:
contexts:
- FeatureContext:
parameters: &parameters
test_key: test_value
- Behat\MinkExtension\Context\MinkContext
extensions:
Behat\MinkExtension:
base_url: http://ubceventslocal.dev
goutte: ~
browser_name: 'chrome'
selenium2:
wd_host: "http://127.0.0.1:4444/wd/hub"
default:
suites:
default:
contexts:
- FeatureContext:
parameters:
<<: *parameters
test_key: OVERRIDE
With the imports line at the top or the bottom, when I run behat, I get
```
[Symfony\Component\Yaml\Exception\ParseException]
Reference "parameters" does not exist at line 11 (near "\: *parameters").
```
If I remove `&parameter`s from behat.yml and `<<: *parameters` from config/ctlt-events-config.yml and put the imports
line at the top or the bottom, and then `var_dump( $parameters )` in the` __construct()` method then with both, the
value of `test_key` is always `test_value` and never `OVERRIDE`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment