wohlie / behat-environment
Behat extension to provide environment specific information in a context classes.
Package info
github.com/Wohlie/behat-environment
Type:behat-extension
pkg:composer/wohlie/behat-environment
v1.0.2
2018-10-21 14:04 UTC
Requires
- behat/behat: ^3.0
- pascalc/php-properties: ^1.0
Requires (Dev)
This package is auto-updated.
Last update: 2026-02-22 06:32:34 UTC
README
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
Usage
-
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\EnvAwareContextin your context class to get the environment object.