I'm not seeing where you're calling the cancelOrder method.
It's going to take 4 minutes (12*20/60) if you force the wait of 20 seconds per order item.
$orders = [
['type' => 'bread', 'amount' => 2],
['type' => 'bread', 'amount' => 10],
];
$bakingService->sendOrder($orders);
You want to test that code and check that the total ends up as 12, correct?
Edit:
queue up 10 units two times, then cancel after creating 2 on the first order
Wait, why is it being cancelled after creating 2 of the first order? I'm not seeing that in the code. Is that supposed to be round robin?
That aside many places I would suggest refactoring to a more declarative. e.g.:
//before
$bakery->{$this->order->type} += 1;
$bakery->save();
$this->order->remaining_amount -= 1;
$this->order->save();
//after
$bakery->increment($this->order->type);
$this->order->decrement('remaining_amount');
And:
$nextOrder->setStatus('in_progress');