K
K
Kirill Djonua2016-03-24 16:33:14
Yii
Kirill Djonua, 2016-03-24 16:33:14

How to test RabbitMQ queue with codeception?

Hello,
I need to test a rabbitmq queue i.e. in the test to check its contents. Before the test, you need to clear the queue.
1. How to clear the queue programmatically before the test?
2. If during the test the data is not added to the queue, then it will be pointless to listen to the queue further, how should the wait be interrupted in this case?
==============================
updated
I'm testing a Yii2 Behavior that reacts to an ActiveRecord::EVENT_AFTER_INSERT event and adds some data in queue. In the test, I create an AR model, call the corresponding event on it and see what appeared in the queue. In this context, I'm interested in answers to my questions

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2016-03-24
@miraage

Everything is tested very simply. The data in the queue must be written by the service. In tests in mock this service, replacing the implementation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question