zenstruck / messenger-test

Assertions and helpers for testing your symfony/messenger queues.
MIT License
218 stars 15 forks source link

[Fix] ignore receiver detached from transport #52

Closed alli83 closed 1 year ago

alli83 commented 1 year ago

Hello,

Issue explained here: #51

summary: In case there are transports (single or multiple) but also classes implementing ReceiverInterface without being attached to a transport, the registration of "the transport" is prevented because it implements receiverInterface but not transportInterface.

Proposal: Check if's a TransportInterface before calling register of testTransportRegistry

kbond commented 1 year ago

Thanks for the fix @alli83!

I'm not familiar with advanced messenger usage. I'm just curious, what's the use case for having a receiver that's not also a transport?

alli83 commented 1 year ago

The data was already stored and there was just a need to use some messenger concepts in order to facilitate some data processing which consisted in setting up a process using these concepts like the Envelope, the Receiver etc.

imho, it might be a little bit a peculiar use case but it would be cool to avoid that the presence of these concepts, used rather individually, prevents from finding the transport that we really want to test.

Thanks for your feedback!

kbond commented 1 year ago

Thanks @alli83!