class TestMailer extends TestMailer (View source)

Same principle as core TestMailer class, but saves emails in TestSessionEnvironment to share the state between PHP calls (CLI vs. browser).

Properties

protected deprecated array $emailsSent from  TestMailer
protected TestSessionEnvironment $testSessionEnvironment

Methods

public
bool
send(Email $email)

No description

protected
saveEmail(array $data)

Save a single email to the log

public
clearEmails()

Clear the log of emails sent

public
array|null
findEmail(string $to = null, string $from = null, string $subject = null, string $content = null)

Search for an email that was sent.

public
__construct()

No description

public
array
findEmails($to = null, $from = null, $subject = null, $content = null)

Search for all emails.

Details

bool send(Email $email)

No description

Parameters

Email $email

Return Value

bool

protected saveEmail(array $data)

Save a single email to the log

Parameters

array $data

A map of information about the email

clearEmails()

Clear the log of emails sent

array|null findEmail(string $to = null, string $from = null, string $subject = null, string $content = null)

Search for an email that was sent.

All of the parameters can either be a string, or, if they start with "/", a PREG-compatible regular expression.

Parameters

string $to
string $from
string $subject
string $content

Return Value

array|null

Contains keys: 'Type', 'To', 'From', 'Subject', 'Content', 'PlainContent', 'AttachedFiles', 'HtmlContent'

__construct()

No description

array findEmails($to = null, $from = null, $subject = null, $content = null)

Search for all emails.

All of the parameters can either be a string, or, if they start with "/", a PREG-compatible regular expression.

Parameters

$to
$from
$subject
$content

Return Value

array

Contains the keys: 'type', 'to', 'from', 'subject', 'content', 'plainContent', 'attachedFiles', 'customHeaders', 'htmlContent', 'inlineImages'