PHPackages                             twentytwo-labs/behat-amqp - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. twentytwo-labs/behat-amqp

AbandonedArchivedLibrary[Queues &amp; Workers](/categories/queues)

twentytwo-labs/behat-amqp
=========================

Behat Amqp Context to test AMQP messages, based on Swarrot library and PECL AMQP php extension.

1.0.1(3y ago)0331MITPHP

Since May 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/TwentytwoLabs/behat-amqp)[ Packagist](https://packagist.org/packages/twentytwo-labs/behat-amqp)[ RSS](/packages/twentytwo-labs-behat-amqp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (4)Used By (0)

twentytwo-labs/behat-amqp
=========================

[](#twentytwo-labsbehat-amqp)

This project is an extension built for Behat that allows you to test AMQP messages.

It is based on Swarrot library and PECL AMQP php extension.

Setup
-----

[](#setup)

Simply add the

- AmqpContext to your behat.yml config:

```
default:
    suites:
        your_suite:
            ...
            contexts:
                - ...
                - 'TwentytwoLabs\BehatAmqpExtension\Context\AmqpContext'

```

- BehatAmqpExtension to your behat.yml config:

```
default:
   extension:
    ...
    TwentytwoLabs\BehatAmqpExtension: ~
```

By default the BehatAmqpExtension uses the default connection to RabbitMQ:

```
host: localhost
port: 5672
vhost: /
login: guest
password: guest
```

But you can override this configuration with your own values when you add the AmqpContext to your behat.yml file:

```
default:
   extension:
    ...
    TwentytwoLabs\BehatAmqpExtension:
        host: your_custom_host
        port: 5672
        vhost: /
        login: your_custom_login
        password: your_custom_password
```

How to use
----------

[](#how-to-use)

In your Behat test scenarios you can use these steps to test your AMQP Messages:

- `Then I set message properties:` (with properties described as YAML in a Gherkin PyStringNode)
- `Then I set message body:` (with body as a Gherkin PyStringNode)
- `Then I publish message with routing key :routingKey` (this will publish a message to RabbitMQ with previously set properties and/or body)
- `Then I purge queue :queue_name` (will purge all messages in that queue)
- `Given I have :count message(s) in amqp :transport queue`
- `Given I have messages in amqp :transport queue`
- `Given I wait :sleep second(s)`
- `Then I consume a message from queue :queue_name`
- `Then the message should have property :property equal to :value`
- `Then the message should have header :header equal to :value`
- `Then the message body should contain :body`
- `Then the message body should be equal to :body`
- `Then the message body should be match to :body`
- `Then the message body should have JSON node :node equal to :value`
- `Then print the message body` (to display the content of your message in console)
- `Then print the message properties` (to display the message properties in console)

For a fully functional example see our Behat feature file: `features/context.feature`

Licence
-------

[](#licence)

MIT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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 ~82 days

Total

3

Last Release

1290d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e755df79c9237f59677baef80e49defca9c8a7988c149e5024fa0ccc063c365?d=identicon)[ThibautAlgrin](/maintainers/ThibautAlgrin)

---

Top Contributors

[![thibaut-algrin](https://avatars.githubusercontent.com/u/2413615?v=4)](https://github.com/thibaut-algrin "thibaut-algrin (3 commits)")

---

Tags

BehatAMQP

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/twentytwo-labs-behat-amqp/health.svg)

```
[![Health](https://phpackages.com/badges/twentytwo-labs-behat-amqp/health.svg)](https://phpackages.com/packages/twentytwo-labs-behat-amqp)
```

###  Alternatives

[php-amqplib/rabbitmq-bundle

Integrates php-amqplib with Symfony &amp; RabbitMq. Formerly emag-tech-labs/rabbitmq-bundle, oldsound/rabbitmq-bundle.

1.3k20.1M65](/packages/php-amqplib-rabbitmq-bundle)[odolbeau/rabbit-mq-admin-toolkit

RabbitMQ administration toolkit

821.7M1](/packages/odolbeau-rabbit-mq-admin-toolkit)[brave-sir-robin/amqphp

AMQP 0.9.1 Protocol Implementation in pure PHP

7932.6k](/packages/brave-sir-robin-amqphp)

PHPackages © 2026

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