Closed stefnats closed 2 years ago
Thanks for the PR, I appreciate your help. Recently I have started working on v2. I will try to include this one if possible.
Mate, thanks for the PR. I have moved the Laravel Support to https://github.com/ssi-anik/laravel-amqp which also includes testing.
Thanks for the support.
Motivation:
I want to be able to test if some messages have been published / consume by
app('amqp')
without interacting with a RabbitMQ Server. This is very useful for Test Driven Development using PHPUnit, PEST, etc.Usage:
With this you can just call:
This overwrites
app('amqp')
and lets you publish / consume messages without communicating with an actual RabbitMQ Server. Also, there are a few Assertions for PHPUnit:For publishing, just use the usual
app('amqp')->publish(...)
code.For consuming, use the
app('amqp')->consume(...)
code. It also takes another (nullable) argument that the consumer should be stopped after x seconds.Please also look into this and give it a test drive. I hope this helps some folks.