dimanche 21 janvier 2018

Symfony: How to test that an email is sent in a KernelTestCase

I wrote a Symfony Command which sends out newsletter emails (in the future the Command should be executed via a cronjob). Now I want to test it. I wrote a CommandTest which extends the KernelTestCase (like the Docs point out https://symfony.com/doc/current/console.html#testing-commands). Currently I'm just checking the Commands output, but I also want to check if the emails are sent and check the emails content. Is this possible like in the a WebTestCase? (https://symfony.com/doc/current/email/testing.html)

Aucun commentaire:

Enregistrer un commentaire