PHPackages                             wohlie/behat-environment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. wohlie/behat-environment

ActiveBehat-extension[Testing &amp; Quality](/categories/testing)

wohlie/behat-environment
========================

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

v1.0.2(7y ago)014MITPHP

Since Jun 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Wohlie/behat-environment)[ Packagist](https://packagist.org/packages/wohlie/behat-environment)[ RSS](/packages/wohlie-behat-environment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Behat Environment Extension [![License](https://camo.githubusercontent.com/e1a294150474bbdf976221416c75ce4c49c8e215950f6ab3dc943cb25e38d3e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f576f686c69652f62656861742d656e7669726f6e6d656e742e737667)](https://packagist.org/packages/Wohlie/behat-environment) [![Build Status](https://camo.githubusercontent.com/33c1993bb64b8b69e68e49a4afb865c29bab25e96c291d3814391f1ad1e142d0/68747470733a2f2f7472617669732d63692e636f6d2f576f686c69652f62656861742d656e7669726f6e6d656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Wohlie/behat-environment) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/b0c6c4d6a926f912551f8dc10de84c923d25bdc9f013099e71893cb051dab8ee/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f576f686c69652f62656861742d656e7669726f6e6d656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Wohlie/behat-environment/?branch=master)
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#behat-environment-extension---)

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
-----

[](#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.

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Total

3

Last Release

2756d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec70aa7f2b8c7eadf8853ac9ae2197f5c03e01b79794796c5ce02517d971a780?d=identicon)[Wohlie](/maintainers/Wohlie)

---

Top Contributors

[![Wohlie](https://avatars.githubusercontent.com/u/329240?v=4)](https://github.com/Wohlie "Wohlie (12 commits)")

---

Tags

behatbehat-contextbehat-contextsbehat-extensionphpBehatbehat-extensionbehat-contextbehat-contexts

### Embed Badge

![Health badge](/badges/wohlie-behat-environment/health.svg)

```
[![Health](https://phpackages.com/badges/wohlie-behat-environment/health.svg)](https://phpackages.com/packages/wohlie-behat-environment)
```

###  Alternatives

[sensiolabs/behat-page-object-extension

Page object extension for Behat

1166.5M26](/packages/sensiolabs-behat-page-object-extension)[laracasts/behat-laravel-extension

Laravel extension for Behat

2611.3M12](/packages/laracasts-behat-laravel-extension)[imbo/behat-api-extension

API extension for Behat

1082.5M9](/packages/imbo-behat-api-extension)[dmore/behat-chrome-extension

Behat extension for controlling Chrome without Selenium

3313.2M356](/packages/dmore-behat-chrome-extension)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

593.6M37](/packages/dvdoug-behat-code-coverage)[bex/behat-extension-driver-locator

Driver locator tool for behat extensions

385.2M4](/packages/bex-behat-extension-driver-locator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
