Perforce Chronicle 2012.2/486814
API Documentation

Workflow_Test_MailTransport Class Reference

Custom email transport for Zend_Mail primarily intended for testing. More...

List of all members.

Public Member Functions

 getSentMails ()
 Get list of emails registered by _sendMail() method since last reset.
 reset ()
 Reset sent emails register.

Protected Member Functions

 _sendMail ()
 Add email properties to the sent emails register.

Protected Attributes

 $_sentMailsRegister = array()

Detailed Description

Custom email transport for Zend_Mail primarily intended for testing.

No real emails are sent. Instead of that, emails that would normally be sent by _sendEmail() method are saved in the register and values can be checked by calling getSentMails().

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

Workflow_Test_MailTransport::_sendMail ( ) [protected]

Add email properties to the sent emails register.

Does not send any real email.

    {
        $this->_sentMailsRegister[] = array(
            'to'        => $this->recipients,
            'body'      => $this->body,
            'subject'   => $this->_mail->getSubject(),
            'headers'   => $this->_getHeaders(null),
        );
    }
Workflow_Test_MailTransport::getSentMails ( )

Get list of emails registered by _sendMail() method since last reset.

Returns:
array list of emails registered by _sendMail() method.
    {
        return $this->_sentMailsRegister;
    }
Workflow_Test_MailTransport::reset ( )

Reset sent emails register.

    {
        $this->_sentMailsRegister = array();
    }

Member Data Documentation

Workflow_Test_MailTransport::$_sentMailsRegister = array() [protected]

The documentation for this class was generated from the following file: