mercredi 13 mars 2019

Laravel: How to write a integration test for Notification that sends email

How one would test email is sent as a final outcome after triggering a notification or doing an action that triggers notification?

Ideally, there is a notification merely for sending an email. My first thought was to trigger it and then check if Mail::assertSent() is sent. However, it appears that this does not work as Notification returns Mailable but does not invoke Mail::send().

Relevant GitHub issue: https://github.com/laravel/framework/issues/27848

Aucun commentaire:

Enregistrer un commentaire