Nospoon
111
4
Laravel

Queue::assertPushed() not working

Posted 7 months ago by Nospoon

I have a job that's being dispatched with SendFax::dispatchNow($fax), i can confirm it being dispatched by running dd() from inside the job, however when I try to test it with Queue:fake() and then \Queue::assertPushed(SendFax::class), it claims it didn't push, the test fails with The expected [App\Jobs\SendFax] job was not pushed. I tried changing dispatchNow() to dispatch() also but that didn't help. Any ideas what could be wrong?

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.