Did you try just calling both?
Queue::assertPushed(function (ShipOrder $job) use ($order) {
return $job->order->id === $order->id;
});
Queue::assertPushed(ShipOrder::class, 123);
Looking through the docs it appears you can assert the job pushed passes a truth test, or you can get the count... but is it possible to do both? It does not appear so from my testing:
Queue::assertPushed(function (ShipOrder $job) use ($order) {
return $job->order->id === $order->id;
}, 123);
When I use this, the callback param (123) seems to be disregarded when using a truth test as the first condition instead of the class string. I need to use both, to get the number of jobs queued with a given truth test, but not seeing any way to accomplish that.
Please or to participate in this conversation.