Permalink
Browse files

Parser->getMessageBody() type exception clarified, test added for get…

…InlineParts exception()
  • Loading branch information...
dorianfm committed Oct 24, 2017
1 parent 8c19e52 commit 8e2f70bfc73d22c4c68991dfe8797eb051113979
Showing with 13 additions and 2 deletions.
  1. +1 −1 src/Parser.php
  2. +12 −1 tests/ExceptionTest.php
@@ -363,7 +363,7 @@ public function getMessageBody($type = 'text')
$inline_parts = $this->getInlineParts($part_type);
$body = empty($inline_parts) ? '' : $inline_parts[0];
} else {
throw new Exception('Invalid type specified for getMessageBody(). "type" can either be text or html.');
throw new Exception('Invalid type specified for getMessageBody(). "type" can either be text, html or htmlEmbeded.');
}
if ($type == 'htmlEmbedded') {
@@ -83,14 +83,25 @@ public function testGetHeadersRaw()
/**
* @expectedException Exception
* @expectedExceptionMessage Invalid type specified for getMessageBody(). "type" can either be text or html.
* @expectedExceptionMessage Invalid type specified for getMessageBody(). "type" can either be text, html or htmlEmbeded.
*/
public function testgetMessageBody()
{
$Parser = new Parser();
$Parser->getMessageBody('azerty');
}
/**
* @expectedException Exception
* @expectedExceptionMessage Invalid type specified for getInlineParts(). "type" can either be text or html.
*/
public function testgetInlineParts()
{
$Parser = new Parser();
$Parser->getInlineParts('azerty');
}
/**
* @expectedException Exception
* @expectedExceptionMessage You must not call MimeMailParser::setText with an empty string parameter

0 comments on commit 8e2f70b

Please sign in to comment.