-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fixes #5962 #6157
Fixes #5962 #6157
Conversation
@@ -107,8 +107,12 @@ public function getMime() | |||
public function generateMessage($EOL = Mime::LINEEND) | |||
{ | |||
if (!$this->isMultiPart()) { | |||
$part = current($this->parts); | |||
$body = $part->getContent($EOL); | |||
if (!empty($this->parts)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you swap this to remove the else
?
@Ocramius done ;) please let me know if I missed something , Thank you ;) |
*/ | ||
public function testPassEmptyArrayIntoSetPartsShouldReturnEmptyString() | ||
{ | ||
$mailMessage = new Mail\Message(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really need the mail dependency to testZend\Mime
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is to proof that this test fix the issue based on #5962 explanation, should I remove it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samsonasik an integration test in ZendTest\Mail
would be better (plus the unit test here)
@Ocramius done ;) I added test in |
@samsonasik thanks, this is much cleaner! |
…ng-on-no-part' into develop Close zendframework/zendframework#5962 Close zendframework/zendframework#6157 Forward Port zendframework/zendframework#5962 Forward Port zendframework/zendframework#6157
…ng-on-no-part' into develop Close zendframework/zendframework#5962 Close zendframework/zendframework#6157 Forward Port zendframework/zendframework#5962 Forward Port zendframework/zendframework#6157
Fixes #5962 . Based on Zend\Mime\Message::generateMessage() comment description, If no part had been added, an empty string is returned.