mercredi 8 février 2017

How to test an email's subject with laravel's Mailable

I'm wondering, if there is an easy and direct way to test the email's subject using the new Mailable function of Laravel

I have a class which can send 5 different emails, but all of them to the same person, so that testing if an email was sent to a concrete person is not really a complete test. I need to know if a concrete email was sent to a concrete person.

I think, using the email's subject to test the uniqueness is the best way. If you have a better way please tell me.

I have this:

Mail::assertSentTo([Config::get('mail.backend')], SendEmail::class);

And I would like to add something like this

Mail::assertSubject('My Subject', SendEmail::class);

Is there a way to do this??

Thank you!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kGTk9O
via IFTTT

Aucun commentaire:

Enregistrer un commentaire