Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing failure transport #71

Open
mtret opened this issue Jan 26, 2024 · 2 comments
Open

Testing failure transport #71

mtret opened this issue Jan 26, 2024 · 2 comments

Comments

@mtret
Copy link

mtret commented Jan 26, 2024

Hi, is there a way of testing whether failed messages end up in a correct failure_transport? Basically what I want to do is something like this:

public function testOrderFailure(): void {
    $this->transport('failed_order')->queue()->assertEmpty();
    $this->transport('async_order')->queue()->assertEmpty();
    $this->transport('async_order')->send(new Envelope(new OrderPaidMessage($this->order))); 
    $this->transport('async_order')->process(); //exception will be thrown

    $this->transport('async_order')->queue()->assertEmpty();
    $this->transport('failed_order')->queue()->assertCount(1);
}

I've got ?catch_exceptions=false configured for the async_order transport-

@kbond
Copy link
Member

kbond commented Feb 4, 2024

I'd like this to be possible but haven't dug into this yet. I guess the code above doesn't work?

Related: #2

@mtret
Copy link
Author

mtret commented Feb 4, 2024

Yeah, the code does not work. Thank you though. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants