User tests: Successful: Unsuccessful:
Pull Request for Issue #36478
If the Mail Template was not found in the db, we cannot send an email, therefore return false before trying to do lots of things based on the template that doesnt exist and avoid error messages
Code review
$mailer = new MailTemplate('com_bftest.invalidtemplateid', 'en-GB');
// ...
$sent = $mailer->send();
Load of PHP notices and a 'Message body empty' warning.
// $sent === false
$sent = $mailer->send();
None
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Title |
|
Labels |
Added:
?
|
I would write a Unit test for this but... ComponentHelper::getParams /facepalm/ and static calls cannot be mocked :(
I mean if you really wanna go ham - which I strongly encourage of course :) You should be able to mock the params in the db I think. I'll see if I can dig out an example tomorrow.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-01-04 17:16:55 |
Closed_By | ⇒ | wilsonge |
Thanks!
I would write a Unit test for this but...
ComponentHelper::getParams
/facepalm/ and static calls cannot be mocked :(