Download the PHP package ygalescot/behat-swarrot-context without Composer
On this page you can find all versions of the php package ygalescot/behat-swarrot-context. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ygalescot/behat-swarrot-context
More information about ygalescot/behat-swarrot-context
Files in ygalescot/behat-swarrot-context
Package behat-swarrot-context
Short Description Behat Swarrot Context to test AMQP messages, based on Swarrot library and PECL AMQP php extension.
License MIT
Informations about the package behat-swarrot-context
ygalescot/behat-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
Simply add the SwarrotContext to your behat.yml config:
By default the SwarrotContext uses the default connection to RabbitMQ:
But you can override this configuration with your own values when you add the SwarrotContext to your behat.yml file:
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
MIT
All versions of behat-swarrot-context with dependencies
behat/behat Version ^3.4
symfony/yaml Version ^3.4
ext-amqp Version *