My Laravel 5.5 application has a Product
model. The Product
model has a dispatchesEvents
property that looks like this:
/*
The problem here is that the listener is not the job pushed to the queue. Instead, there's a Illuminate\Events\CallQueuedListener
job that is queued and will in turn call the appropriate listener when resolved.
So you could do your assertion like this:
Queue::assertPushed(CallQueuedListener::class, function ($job) {
return $job->class == CreateProductInMagento::class;
});