shawnyv's avatar
Level 14

Mail - Test Mail Not Sent To Specific User in Laravel 5.3

Hi all,

I've just started mocking my Mail asserts, and using the fantastic 5.3 features to wrap it behind the Mail class.

I'm loving the ability to assert MailSentTo($user, $mail), but was wondering how to test that a mail was not sent to a specific user.

I've got a daily email reminder that should go out to users based on activity - I want to test that it did get sent to some users, but not to others.

I couldn't find an "AssertNotSentTo" method, just the "AssertNotSent" method. I'm expecting the mail to be sent, i just want to make sure it's only sent to the users it should go to.

Is there a simple method I'm missing, or an easy way to add this assertion?

Thanks!

0 likes
0 replies

Please or to participate in this conversation.