I'm using laravel 8 and Laravel Sail.
I'm trying to test a email that is being sent from a job but is not being sent, no matter what I do. Here's my code
Bus::fake();
Mail::fake();
TheProductDoesNotExists::dispatch($this->channel, $document['product'], $document['name']);
Event::assertDispatched(TheProductDoesNotExists::class);
Mail::assertSent(ProductMissing::class);
And I get
The expected [App\Mail\ProductMissing] mailable was not sent.
Failed asserting that false is true.
Inside the Job I even have a logger in the handle method but nothing is logged
public function handle()
{
logger('from the job');
$alertTo = 'test@test';
Mail::to($alertTo)->send(
new ProductMissing($this->product, $this->orderName)
);
}
And nothing. Any help would be really appreciated! Thanks