mercredi 1 février 2017

Laravel 5.4 testing with Mail::fake - how to access message body?

I'm running Laravel 5.4 and testing Mailables with Mail::fake() and Mail::assertSent(). There are assertions for things like hasTo($email) and hasCc($email), but there doesn't seem to be a way to access the message contents. I would like to test that the email body contains a particular string.

Pseudocode:

Mail::assertSent(UserInvited::class, function($mail) use($token) {
    return $mail->bodyContains($token); # that method does not really exist
});

Is this possible?



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

Aucun commentaire:

Enregistrer un commentaire