Email and mailer assertions.
$_email
protected Asserts the email attachments contain the given filename (and optionally file info).
Asserts email BCC'd addresses contain given email address (and optionally name).
Asserts email CC'd addresses contain given email address (and optionally name).
$needle
. $needle
. $expected
. $needle
. Asserts email is sent to only the given recipient's address (and optionally name).
Asserts email recipients' list contains given email address (and optionally name).
assertEmailAttachmentsContains( string $filename , array $file null , string|null $message null )
Asserts the email attachments contain the given filename (and optionally file info).
$filename
$file
optional null $message
optional null assertEmailBcc( string $email , string|null $name null , string|null $message null )
Asserts email is BCC'd to only one email address (and optionally name).
$email
$name
optional null $message
optional null assertEmailBccContains( string $email , string|null $name null , string|null $message null )
Asserts email BCC'd addresses contain given email address (and optionally name).
$email
$name
optional null $message
optional null assertEmailCc( string $email , string|null $name null , string|null $message null )
Asserts email is CC'd to only one email address (and optionally name).
$email
$name
optional null $message
optional null assertEmailCcContains( string $email , string|null $name null , string|null $message null )
Asserts email CC'd addresses contain given email address (and optionally name).
$email
$name
optional null $message
optional null assertEmailFrom( string $email , string|null $name null , string|null $message null )
Asserts email's sender email address and optionally name.
$email
$name
optional null $message
optional null assertEmailHtmlMessageContains( string $needle , string|null $message null )
Asserts HTML email content contains $needle
.
$needle
$message
optional null assertEmailMessageContains( string $needle , string|null $message null )
Asserts email content (both text and HTML) contains $needle
.
$needle
$message
optional null assertEmailSubject( string $expected , string|null $message null )
Asserts email's subject contains $expected
.
$expected
$message
optional null assertEmailTextMessageContains( string $needle , string|null $message null )
Asserts text email content contains $needle
.
$needle
$message
optional null assertEmailTo( string $email , string|null $name null , string|null $message null )
Asserts email is sent to only the given recipient's address (and optionally name).
$email
$name
optional null $message
optional null assertEmailToContains( string $email , string|null $name null , string|null $message null )
Asserts email recipients' list contains given email address (and optionally name).
$email
$name
optional null $message
optional null email( boolean $new false )
Creates an email instance overriding its transport for testing purposes.
$new
optional false Cake\Mailer\Email
getMockForMailer( string $className , array $methods [] )
Generates mock for given mailer class.
$className
$methods
optional [] Cake\Mailer\Mailer
|PHPUnit_Framework_MockObject_MockObjectsend( array|string|null $content null )
Sends email using the test email instance.
$content
optional null protected Cake\Mailer\Email
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.4/class-Cake.TestSuite.EmailAssertTrait.html