Level 73
This might shed some light
https://rafaelogic.medium.com/making-unit-test-for-sending-email-using-laravel-d1744be9c89f
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
public function test_can_send_email()
{
Mail::fake();
Mail::send([], [], function (\Illuminate\Mail\Message $message) {
return $message
->from('[email protected]')
->to('[email protected]')
->subject('test');
});
Mail::assertSentCount(1);
Mail::assertQueuedCount(1);
}
Both my assertions keep failing, how should I assert instead?
In the end, I used mailables
Please or to participate in this conversation.