Allows to inject the current project environment into a context. The extension currently only supports the version number.
The project environment can be extracted from the following resources:
package.json
- The version will be extracted from the object key
version
- The version will be extracted from the object key
composer.json
- The version will be extracted from the object key
version
- The version will be extracted from the object key
*.property
- The version will be extracted from the key
artifact.version
- The version will be extracted from the key
-
Install it:
$ composer require wohlie/behat-environment
-
Enable this extension and configure Behat to use it:
# behat.yml default: # ... extensions: Wohlie\Behat\Environment: property_file: '%paths.base%/package.json'
The parameter property_file
is required.
- Implement the interface
\Wohlie\Behat\Environment\Context\EnvAwareContext
in your context class to get the environment object.