PHPackages                             zalas/behat-no-extension - 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. zalas/behat-no-extension

ActiveLibrary[Testing &amp; Quality](/categories/testing)

zalas/behat-no-extension
========================

The ultimate Behat extension

v2.2.0(6y ago)31137.9k↓47.1%31MITPHPPHP ^7.2

Since Feb 3Pushed 6y ago2 watchersCompare

[ Source](https://github.com/jakzal/BehatNoExtension)[ Packagist](https://packagist.org/packages/zalas/behat-no-extension)[ Docs](https://github.com/jakzal/BehatNoExtension)[ RSS](/packages/zalas-behat-no-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (7)Versions (9)Used By (1)

Behat No Extension
==================

[](#behat-no-extension)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/968e600bde1167cdd836659833778c7d3084e4f8ef01c488a67a3e0fa7c2776a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a616b7a616c2f42656861744e6f457874656e73696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jakzal/BehatNoExtension/?branch=master)[![Build Status](https://camo.githubusercontent.com/9fe1b2a1a0871a851b31fd5ac5c85bedc810ea74a25736ea8700e47f933d75ba/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a616b7a616c2f42656861744e6f457874656e73696f6e2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jakzal/BehatNoExtension/build-status/master)[![Build Status](https://camo.githubusercontent.com/fb03777210780abcae24512f207c77c023695ff9506c17a0fb51452207440cd6/68747470733a2f2f7472617669732d63692e6f72672f6a616b7a616c2f42656861744e6f457874656e73696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jakzal/BehatNoExtension)

This Behat extension makes it possible to extend Behat without having to write an extension yourself.

Installation
------------

[](#installation)

This extension requires:

- Behat ^3.0
- PHP ^7.1

The easiest way to install it is to use Composer

```
$ composer require --dev zalas/behat-no-extension

```

Next, activate the extension in your `behat.yml`:

```
# behat.yml
default:
  extensions:
    Zalas\Behat\NoExtension: ~
```

Importing service definitions
-----------------------------

[](#importing-service-definitions)

Extension enables you to load service definitions and parameters from configuration files specified in the `imports` section:

```
# behat.yml
default:
  extensions:
    Zalas\Behat\NoExtension:
      imports:
        - features/bootstrap/config/services.yml
```

These should simply be [Symfony's service container](http://symfony.com/doc/current/components/dependency_injection/introduction.html#setting-up-the-container-with-configuration-files)configuration files:

```
# features/bootstrap/config/services.yml
services:
  Acme\SimpleArgumentResolver:
    tags:
      - { name: context.argument_resolver }

parameters:
  acme.foo: boo!
```

Yaml, xml and php formats are currently supported.

Note that any classes you'd like to use should be autoloaded by composer. For the example above, `autoload-dev` or `autoload` should include the `Acme\\` autoloader prefix.

Injecting services into contexts
--------------------------------

[](#injecting-services-into-contexts)

Enable the argument resolver to take advantage of the built in support for service injection:

```
# behat.yml
default:
  extensions:
    Zalas\Behat\NoExtension:
      argument_resolver: true
      imports:
        - features/bootstrap/config/services.yml
```

Assuming services you'd like to inject into contexts are defined in `features/bootstrap/Acme`, and they're autoloaded by composer, you can now start defining them in your configuration file:

```
# features/bootstrap/config/services.yml
services:

    Acme\:
        resource: '../Acme'
        public: true
        autowire: true
```

The above example relies on autoworing, but you could also define each service explicitly.

An example composer autoloader configuration:

```
{
    "autoload-dev": {
        "psr-4": {
            "Acme\\": "features/bootstrap/Acme"
        }
    }
}
```

Given there's a class `Acme\Foo` defined, it can now be injected into contexts:

```
use Acme\Foo;
use Behat\Behat\Context\Context;

class FeatureContext implements Context
{
    private $foo;

    public function __construct(Foo $foo)
    {
        $this->foo = $foo;
    }
}
```

Defining parameters
-------------------

[](#defining-parameters)

Parameters defined in imported files are also available in `behat.yml`:

```
# behat.yml
default:
  suites:
    search:
      contexts:
        - SearchContext:
            myFoo: '%acme.foo%'
  # ...
```

Furthermore, parameters can also be defined as part of extension's configuration directly in `behat.yml`:

```
# behat.yml
default:
  extensions:
    Zalas\Behat\NoExtension:
      parameters:
        foo: bar
        baz:
          a: 1
          b: 'bazinga!'
```

Contributing
------------

[](#contributing)

Please read the [Contributing guide](CONTRIBUTING.md) to learn about contributing to this project. Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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 ~253 days

Recently: every ~142 days

Total

8

Last Release

2347d ago

Major Versions

v1.1.1 → v2.0.02018-05-25

PHP version history (4 changes)v1.0.0PHP &gt;=5.3.0

1.1.x-devPHP ^5.3||^7.0

v2.0.0PHP ^7.1

v2.2.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/012270929478a287f88353135a39d275db09c1856d344d0245e04df709879262?d=identicon)[jakzal](/maintainers/jakzal)

---

Top Contributors

[![jakzal](https://avatars.githubusercontent.com/u/190447?v=4)](https://github.com/jakzal "jakzal (67 commits)")[![ajgarlag](https://avatars.githubusercontent.com/u/388184?v=4)](https://github.com/ajgarlag "ajgarlag (1 commits)")[![walterdolce](https://avatars.githubusercontent.com/u/6195629?v=4)](https://github.com/walterdolce "walterdolce (1 commits)")

---

Tags

behatbehat-extensioncontainerphppsr-11symfonydependency-injectionBDDBehatextensionservice container

### Embed Badge

![Health badge](/badges/zalas-behat-no-extension/health.svg)

```
[![Health](https://phpackages.com/badges/zalas-behat-no-extension/health.svg)](https://phpackages.com/packages/zalas-behat-no-extension)
```

###  Alternatives

[laracasts/behat-laravel-extension

Laravel extension for Behat

2611.3M12](/packages/laracasts-behat-laravel-extension)[dmarynicz/behat-parallel-extension

Parallel extension for Behat

27544.3k](/packages/dmarynicz-behat-parallel-extension)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

593.6M37](/packages/dvdoug-behat-code-coverage)[leanphp/behat-code-coverage

Generate Code Coverage reports for Behat tests

50359.8k2](/packages/leanphp-behat-code-coverage)[soulcodex/laravel-behat

Laravel Extension for easy integration with Behat

1760.8k](/packages/soulcodex-laravel-behat)[macpaw/behat-messenger-context

Behat Context for testing Symfony Messenger component

16232.9k](/packages/macpaw-behat-messenger-context)

PHPackages © 2026

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