PHPackages                             ygalescot/behat-swarrot-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. ygalescot/behat-swarrot-context

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

ygalescot/behat-swarrot-context
===============================

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

0.1(7y ago)161MITPHP

Since Jul 19Pushed 7y ago2 watchersCompare

[ Source](https://github.com/ygalescot/behat-swarrot-context)[ Packagist](https://packagist.org/packages/ygalescot/behat-swarrot-context)[ RSS](/packages/ygalescot-behat-swarrot-context/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

ygalescot/behat-swarrot-context
===============================

[](#ygalescotbehat-swarrot-context)

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 SwarrotContext to your behat.yml config:

```
default:
    suites:
        your_suite:
            ...
            contexts:
                - ...
                - 'Ygalescot\BehatSwarrotContext\Context\SwarrotContext'

```

By default the SwarrotContext 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 SwarrotContext to your behat.yml file:

```
default:
    suites:
        your_suite:
            ...
            contexts:
                - ...
                - 'Ygalescot\BehatSwarrotContext\Context\SwarrotContext':
                    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:

- `Given I purge queue :queue_name` (will purge all messages in that queue)
- `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 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 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

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

Unknown

Total

1

Last Release

2853d ago

### Community

Maintainers

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

---

Top Contributors

[![ygalescot](https://avatars.githubusercontent.com/u/12764680?v=4)](https://github.com/ygalescot "ygalescot (1 commits)")

---

Tags

amqpbehatphprabbitmqswarrottesttesting

### Embed Badge

![Health badge](/badges/ygalescot-behat-swarrot-context/health.svg)

```
[![Health](https://phpackages.com/badges/ygalescot-behat-swarrot-context/health.svg)](https://phpackages.com/packages/ygalescot-behat-swarrot-context)
```

###  Alternatives

[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20729.0M124](/packages/mglaman-phpstan-drupal)[drupal/drupal-extension

Drupal extension for Behat

22215.1M147](/packages/drupal-drupal-extension)[friends-of-behat/variadic-extension

Variadic support for behat context arguments

2286.0M446](/packages/friends-of-behat-variadic-extension)[liip/test-fixtures-bundle

This bundles enables efficient loading of Doctrine fixtures in functional test-cases for Symfony applications

1798.3M42](/packages/liip-test-fixtures-bundle)

PHPackages © 2026

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