Skip to content

Behat extension to provide environment specific information in a context classes.

License

Notifications You must be signed in to change notification settings

Wohlie/behat-environment

Repository files navigation

Behat Environment Extension License Build Status Scrutinizer Code Quality

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
  • composer.json
    • The version will be extracted from the object key version
  • *.property
    • The version will be extracted from the key artifact.version

Usage

  1. Install it:

    $ composer require wohlie/behat-environment
  2. 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.

  1. Implement the interface \Wohlie\Behat\Environment\Context\EnvAwareContext in your context class to get the environment object.