forked from zendframework/zendframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding test for escaping of emails that have lines starting with a pe…
…riod character.
- Loading branch information
Elliot Wiltshire
committed
Nov 5, 2013
1 parent
052e76f
commit 0818058
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,34 @@ public function testSendMinimalMail() | |
$this->assertEquals($expectedMessage, $this->connection->getLog()); | ||
} | ||
|
||
public function testSendEscapedEmail() | ||
{ | ||
$headers = new Headers(); | ||
$headers->addHeaderLine('Date', 'Sun, 10 Jun 2012 20:07:24 +0200'); | ||
$message = new Message(); | ||
$message | ||
->setHeaders($headers) | ||
->setSender('[email protected]', 'Ralph Schindler') | ||
->setBody("This is a test\n.") | ||
->addTo('[email protected]', 'ZF DevTeam') | ||
; | ||
$expectedMessage = "EHLO localhost\r\n" | ||
. "MAIL FROM:<[email protected]>\r\n" | ||
. "DATA\r\n" | ||
. "Date: Sun, 10 Jun 2012 20:07:24 +0200\r\n" | ||
. "Sender: Ralph Schindler <[email protected]>\r\n" | ||
. "To: ZF DevTeam <[email protected]>\r\n" | ||
. "\r\n" | ||
. "This is a test\r\n" | ||
. "..\r\n" | ||
. ".\r\n"; | ||
|
||
$this->transport->send($message); | ||
|
||
$this->assertEquals($expectedMessage, $this->connection->getLog()); | ||
|
||
} | ||
|
||
public function testDisconnectCallsQuit() | ||
{ | ||
$this->connection->disconnect(); | ||
|