Skip to content

Commit

Permalink
Tests for messageID
Browse files Browse the repository at this point in the history
Minor cleanup
  • Loading branch information
Synchro committed Aug 30, 2013
1 parent 4075ba4 commit 09a978f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions class.phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -816,11 +816,11 @@ public function setFrom($address, $name = '', $auto = true)
/**
* 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;
}
Expand Down
14 changes: 14 additions & 0 deletions test/phpmailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,20 @@ public function testPopBeforeSmtpBad()
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
*/
Expand Down

0 comments on commit 09a978f

Please sign in to comment.