PHPackages                             friends-of-behat/test-context - 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/test-context

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

friends-of-behat/test-context
=============================

Provides reusable context that helps in testing Behat extensions.

v1.4.0(3mo ago)1723.7k↑29.7%5[1 PRs](https://github.com/FriendsOfBehat/TestContext/pulls)12MITPHPPHP ^8.1CI passing

Since Aug 9Pushed 3w ago3 watchersCompare

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

READMEChangelog (10)Dependencies (8)Versions (12)Used By (12)

Test Context [![License](https://camo.githubusercontent.com/73a4ba81dd9ba252b4f596e981b6d39c66b2b85e5afb62af76657be5244d0224/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f667269656e64732d6f662d62656861742f746573742d636f6e746578742e737667)](https://packagist.org/packages/friends-of-behat/test-context) [![Version](https://camo.githubusercontent.com/6fb297ceb8708b76259d59914ba9d8b680884a81e8233096fe7c52ef408c3564/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667269656e64732d6f662d62656861742f746573742d636f6e746578742e737667)](https://packagist.org/packages/friends-of-behat/test-context) [![Scrutinizer Quality Score](https://camo.githubusercontent.com/ba1f39f1a31d3c64c7a2a4c411537c082f790f05f486b77a56dd4ba4c105d63c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f467269656e64734f6642656861742f54657374436f6e746578742e737667)](https://scrutinizer-ci.com/g/FriendsOfBehat/TestContext/)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#test-context---)

Provides a reusable Behat context for testing Behat extensions. It lets you run Behat inside Behat - setting up temporary configurations, feature files, and contexts, then asserting on the results.

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

[](#installation)

```
composer require friends-of-behat/test-context --dev
```

Configuration
-------------

[](#configuration)

Register the context in your test suite:

```
# behat.yml
default:
    suites:
        default:
            contexts:
                - FriendsOfBehat\TestContext\Context\TestContext
```

```
// behat.php
