- milestone: 899257 --> 6.1
Currently Notification class allows now 2 kind of transports: Zend_Mail_Transport_Smtp and Zend_Mail_Transport_Sendmail
The task is to create a third one: Phprojekt_Mail_Transport_Test that setting it in configuration.ini the email won't be sent but stored in a specific folder file so that its contents may be verified.
The purpose of this is:
1) To verify whole emails contents in Unittest. Sometime (consider whether to do it inside this task scope) has to be added Tests about Notification emails being read the content created by this class.
2) To check manually the email sending action (at least until the point before they go out of our computers) and the contents of the emails, not needing to configure or use a SMTP server.
Summary of the class (done by Sven):
class Phprojekt_Mail_Transport_Test extends Zend_Mail_Transport_Abstract
{
public function __construct ($config)
{
// store configured target directory
}
protected function _sendmail()
{
// Get target directory
// Make up filename, but not random, so the unit test can
// find the file. Maybe based on recipient
// Write mailtext to file like this:
file_put_contents($filename, $this->header . Zend_Mime::LINEEND .
$this->body);
}
}