PHPackages                             friends-of-behat/context-service-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. friends-of-behat/context-service-extension

Abandoned → [friends-of-behat/symfony-extension](/?search=friends-of-behat%2Fsymfony-extension)ArchivedLibrary[Testing &amp; Quality](/categories/testing)

friends-of-behat/context-service-extension
==========================================

Allows to declare and use contexts services in scenario scoped container.

v1.3.0(7y ago)115575.0k↑6157.1%6[1 issues](https://github.com/FriendsOfBehat/ContextServiceExtension/issues)20MITPHPPHP ^7.1

Since Oct 25Pushed 7y ago2 watchersCompare

[ Source](https://github.com/FriendsOfBehat/ContextServiceExtension)[ Packagist](https://packagist.org/packages/friends-of-behat/context-service-extension)[ RSS](/packages/friends-of-behat-context-service-extension/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (6)Dependencies (5)Versions (9)Used By (20)

Context Service Extension [![License](https://camo.githubusercontent.com/49fa02e50e74d17c13d7b4e6dd0dcba4144db5ccdd169dc09d45187ba12fc0ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f667269656e64732d6f662d62656861742f636f6e746578742d736572766963652d657874656e73696f6e2e737667)](https://packagist.org/packages/friends-of-behat/context-service-extension) [![Version](https://camo.githubusercontent.com/f053774b8b94aaabc3d5f50355d31edd47ef31293d245262320045e6df866bfd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667269656e64732d6f662d62656861742f636f6e746578742d736572766963652d657874656e73696f6e2e737667)](https://packagist.org/packages/friends-of-behat/context-service-extension) [![Build status on Linux](https://camo.githubusercontent.com/2c57a1176b3bd05f636d5d8404d15252f7b834a9f199b581024c72f3468b91b9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f467269656e64734f6642656861742f436f6e7465787453657276696365457874656e73696f6e2f6d61737465722e737667)](http://travis-ci.org/FriendsOfBehat/ContextServiceExtension) [![Scrutinizer Quality Score](https://camo.githubusercontent.com/943a795de8255ca9ac20150be9a0f2036ec51aeb86c8271fcd9a051b7d92f16d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f467269656e64734f6642656861742f436f6e7465787453657276696365457874656e73696f6e2e737667)](https://scrutinizer-ci.com/g/FriendsOfBehat/ContextServiceExtension/)
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#context-service-extension----)

#### This library is deprecated! It will not be supported anymore - if you're using it with CrossContainerExtension v1 and SymfonyExtension v1, please consider an upgrade to [SymfonyExtension v2](https://github.com/FriendsOfBehat/SymfonyExtension).

[](#this-library-is-deprecated-it-will-not-be-supported-anymore---if-youre-using-it-with-crosscontainerextension-v1-and-symfonyextension-v1-please-consider-an-upgrade-to-symfonyextension-v2)

Allows to declare and use contexts services in scenario scoped container.

Usage
-----

[](#usage)

1. Install it:

    ```
    $ composer require friends-of-behat/context-service-extension --dev
    ```
2. Enable and configure context service extension in your Behat configuration:

    ```
    # behat.yml
    default:
        # ...
        extensions:
            FriendsOfBehat\ContextServiceExtension:
               imports:
                   - "features/bootstrap/config/services.xml"
                   - "features/bootstrap/config/services.yml"
                   - "features/bootstrap/config/services.php"
    ```
3. Inside one of those files passed to configuration above, create a service tagged with `fob.context_service`.

    ```

    ```

    ```
    # features/bootstrap/config/services.yml
    services:
        acme.my_context:
            class: Acme\MyContext
            tags:
                - { name: fob.context_service }
    ```

    ```
    // features/bootstrap/config/services.php
    use Symfony\Component\DependencyInjection\Definition;

    $definition = new Definition(\Acme\MyContext::class);
    $definition->addTag('fob.context_service');
    $container->setDefinition('acme.my_context', $definition);
    ```
4. Configure your suite to use `acme.my_context` context service (note **contexts\_services** key instead of **contexts**):

    ```
    # behat.yml
    default:
        # ...
           suites:
               default:
                   contexts_services:
                       - acme.my_context
    ```
5. Have fun with your contexts defined in DI container as services! 🎉

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 90.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 ~116 days

Recently: every ~140 days

Total

8

Last Release

2721d ago

Major Versions

v0.3.0 → v1.0.02017-07-10

PHP version history (2 changes)v0.1.0PHP ^5.6|^7.0

v1.0.0PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/75c5d927b0434111db9720dd78af8c83385cf28bb9aeafd031ba8cb0c4ffc558?d=identicon)[Stof](/maintainers/Stof)

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

---

Top Contributors

[![pamil](https://avatars.githubusercontent.com/u/1897953?v=4)](https://github.com/pamil "pamil (64 commits)")[![lchrusciel](https://avatars.githubusercontent.com/u/6213903?v=4)](https://github.com/lchrusciel "lchrusciel (4 commits)")[![franzose](https://avatars.githubusercontent.com/u/708158?v=4)](https://github.com/franzose "franzose (1 commits)")[![gorkalaucirica](https://avatars.githubusercontent.com/u/1749891?v=4)](https://github.com/gorkalaucirica "gorkalaucirica (1 commits)")[![mkilmanas](https://avatars.githubusercontent.com/u/392168?v=4)](https://github.com/mkilmanas "mkilmanas (1 commits)")

---

Tags

behatbehat-contextsbehat-extensiondependency-injectionphp

### Embed Badge

![Health badge](/badges/friends-of-behat-context-service-extension/health.svg)

```
[![Health](https://phpackages.com/badges/friends-of-behat-context-service-extension/health.svg)](https://phpackages.com/packages/friends-of-behat-context-service-extension)
```

PHPackages © 2026

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