is there a way to test with PHPUnit (or maybe other testing framework for PHP) if mail is sent correctly? I have to test a code which uses PHP function mail() . With custom mailer class i could always make a mock, but for mail() ... ? Maybe there is some plugin which is capable to use IMAP and verify if mail is received? (and it should be OS-agnostic if it is possible...)
The solution here would be to wrap mail in a class that could be mocked and use that instead.
I don't see the point in testing mail()
itself, I'm sure it's been thoroughly tested already.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With