Tests for messageID

Minor cleanup
This commit is contained in:
Synchro 2013-08-30 18:51:37 +02:00
parent 4075ba4b6b
commit 09a978fb1c
2 changed files with 16 additions and 2 deletions

View File

@ -816,11 +816,11 @@ class PHPMailer
/**
* Return the Message-ID header of the last email.
* Technically this is the value from the last time the headers were created,
* but it also the message ID of the last sent message except in
* but it's also the message ID of the last sent message except in
* pathological cases.
* @return string
*/
public function GetLastMessageID()
public function getLastMessageID()
{
return $this->lastMessageID;
}

View File

@ -1320,6 +1320,20 @@ EOT;
sleep(2);
}
/**
* Test setting and retrieving message ID
*/
public function testMessageID()
{
$this->Mail->Body = 'Test message ID.';
$id = md5(12345);
$this->Mail->MessageID = $id;
$this->buildBody();
$this->Mail->preSend();
$lastid = $this->Mail->getLastMessageID();
$this->assertEquals($lastid, $id, 'Custom Message ID mismatch');
}
/**
* Miscellaneous calls to improve test coverage and some small tests
*/