PHPackages                             wakeonweb/behat-contexts - 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. [Database &amp; ORM](/categories/database)
4. /
5. wakeonweb/behat-contexts

ActiveLibrary[Database &amp; ORM](/categories/database)

wakeonweb/behat-contexts
========================

Provide some behat contexts

v1.4.0(7y ago)01501[1 issues](https://github.com/WakeOnWeb/behat-contexts/issues)MITPHPPHP ^7.1

Since Jan 21Pushed 7y ago2 watchersCompare

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

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

WakeOnWeb Behat Contexts
========================

[](#wakeonweb-behat-contexts)

Provide some simple behat contexts

```
default:
    suites:
        default:
            contexts:
                - WakeOnWeb\BehatContexts\AmqpContext:
                    transports:
                        # I intentionally did not use syntax %env()% because BEHAT doesn't fully
                        # support this case since Behat and Symfony kernel are not the sames.
                        async_internal: "env(MESSENGER_TRANSPORT_ASYNC_INTERNAL_DSN)"
                        my_second_queue: "DIRECT_DSN"
                    # you can define your own Adapter, it musts implements \WakeOnWeb\BehatContexts\AmqpAdapter\AdapterInterface;
                    # adapterClass: \WakeOnWeb\BehatContexts\AmqpAdapter\SymfonyMessengerAdapter
                    # Create queues if they don't exist.
                    # setupQueuesAutomatically: 1
                - WakeOnWeb\BehatContexts\FidryAliceFixturesContext:
                    # optional
                    # default is %kernel.project_dir%/tests/fixtures
                    # basepath: /var/www/....
                - WakeOnWeb\BehatContexts\DoctrineORMSchemaReloadContext
                - WakeOnWeb\BehatContexts\HttpMockContext:
                    # basepath is %kernel.project_dir%/
                    # optional
                    # mockServers:
                        - {serverName: 'user', port: 8870, host: 'localhost', basePath: '/admin'}
                        - {serverName: 'mailer'}
                    # bodyRequestPath: tests/functional/fixtures/request (default)
                - WakeOnWeb\BehatContexts\SwaggerContext:
                    # basepath is %kernel.project_dir%/
                    # swaggerFile: doc/mySwaggerFile.yaml
                - WakeOnWeb\BehatContexts\FileContext:
                    # optional
                    # basePath: 'test/funtional/fixtures/file'
            paths:
                - tests/Features

```

AmqpContext
-----------

[](#amqpcontext)

If feature/scenario has tag @amqp, it'll automatically remove messages in all queues defined on context.

FidryAliceFixturesContext
-------------------------

[](#fidryalicefixturescontext)

Needs [AliceDataFixtures](https://github.com/theofidry/AliceDataFixtures) and its bundle to be installed.

DoctrineORMSchemaReloadContext
------------------------------

[](#doctrineormschemareloadcontext)

Needs \[DoctrineBundle\] to be installed.

If feature/scenario has tag @database, it'll automatically delete/create doctrine schema for all managers.

You have to create database before by yourself.

HttpMockContext
---------------

[](#httpmockcontext)

Needs [BehatSymfony2Extension](https://github.com/Behat/Symfony2Extension), [InternationHttpMock](https://github.com/InterNations/http-mock)

Configuration:

- mockServers: A mock server set up list. Only name is mandatory.
- bodyRequestPath: Base path for target json response file.

Usage:

You have two way for set up a list of mock.

1. Configuration with tag

    Add your mocks in the suit configuration and use the @mockable tag on the feature or scenario.
2. Steps

    Use "I set up mock servers:" step and don't forget "I tear down mock servers" after use it.

Steps available:

```
Given I set up mock servers:
    | name | port | host | basePath |
Then I tear down mock servers
Given A :method request on :path to the mock server :serverName must be return a :responseCode response
Given A :method request on :path to the mock server :serverName must be return a :responseCode response with content :body
Given A :method request on :path to the mock server :serverName must be return a :responseCode response with file :bodyFileName as content
Given A :method request on path matching :regex to the mock server :serverName must be return a :responseCode response
Given A :method request on path matching :regex to the mock server :serverName must be return a :responseCode response with content :body
Given A :method request on path matching :regex to the mock server :serverName must be return a :responseCode response with file :bodyFileName as content

```

SwaggerContext
--------------

[](#swaggercontext)

Needs: [BehatSymfony2Extension](https://github.com/Behat/Symfony2Extension), [UbirakRestApiBehatExtension](https://github.com/ubirak/rest-api-behat-extension), [SwaggerValidator](https://github.com/WakeOnWeb/swagger),

How to use:

- Set the path of your yaml swagger file (V2 only) in the behat.yml file.
- Use the step after call the endpoint with UbirakRestApi

Steps available:

```
Then I validate Swagger response on :path with :method method and statusCode :statusCode

```

FileContext
-----------

[](#filecontext)

Needs: [BehatSymfony2Extension](https://github.com/Behat/Symfony2Extension),

How to use:

- Set the base path of your fixture file folder (optional, default: tests/functional/fixtures/file)
- Use steps
- Use the @clean-files-after or @clean-files-before tag for clean file created with step "I create file in :path from :file"
- If the scenario generate files, you can clean it with step "I clean all files from folder :folder"

Steps available:

```
Given I create file in :path from :file
Then The file :file must be a copy of :fileExpected
Then One of file present in :path must be a copy of :fileExpected
Then The file :file size is less or equal to :size octet
Then The file :file size is equal to :size octet
Then The file :file mime type must be equal to :mimeType
Then The file :file mime type must be equal to one of following:
Then :number files must be present in folder :path
Then The file with name :fileName must be present in :path
Then I clean all files from folder :folder
Then I clean generated files

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 62.5% 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 ~6 days

Total

6

Last Release

2634d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/47c3006a9e7662031ee9d3fa064238fef88479fd7d60f18dd47f038fbbd7dc5a?d=identicon)[steph\_py](/maintainers/steph_py)

---

Top Contributors

[![stephpy](https://avatars.githubusercontent.com/u/232744?v=4)](https://github.com/stephpy "stephpy (10 commits)")[![rousseauyoann](https://avatars.githubusercontent.com/u/31069421?v=4)](https://github.com/rousseauyoann "rousseauyoann (6 commits)")

---

Tags

ormBehatAMQPcontexts

### Embed Badge

![Health badge](/badges/wakeonweb-behat-contexts/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[doctrine/doctrine-bundle

Symfony DoctrineBundle

4.8k241.3M3.3k](/packages/doctrine-doctrine-bundle)[doctrine/persistence

The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.

4.1k286.5M763](/packages/doctrine-persistence)[gedmo/doctrine-extensions

Doctrine behavioral extensions

4.1k118.8M365](/packages/gedmo-doctrine-extensions)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[beberlei/doctrineextensions

A set of extensions to Doctrine 2 that add support for additional query functions available in MySQL, Oracle, PostgreSQL and SQLite.

2.1k75.1M146](/packages/beberlei-doctrineextensions)

PHPackages © 2026

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