From 09a978fb1c7c538a51952b3010b11b57194f6e4b Mon Sep 17 00:00:00 2001 From: Synchro Date: Fri, 30 Aug 2013 18:51:37 +0200 Subject: [PATCH] Tests for messageID Minor cleanup --- class.phpmailer.php | 4 ++-- test/phpmailerTest.php | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/class.phpmailer.php b/class.phpmailer.php index b467c716..fe37a93b 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -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; } diff --git a/test/phpmailerTest.php b/test/phpmailerTest.php index 92ff5049..1b4cf1ab 100644 --- a/test/phpmailerTest.php +++ b/test/phpmailerTest.php @@ -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 */