Exemplo n.º 1
0
 /**
  * Test body in advanced hierarchy
  */
 public function testBodyAdvanced()
 {
     $message1 = new Mime\Message();
     $htmlPart = new Mime\Part('simple <b>html</b>');
     $htmlPart->type = 'text/html';
     $textPart = new Mime\Part('simple text');
     $textPart->type = 'text/plain';
     $emptPart = new Mime\Part('simple text alternative');
     $emptPart->type = '';
     $message1->addPart($htmlPart);
     $message2 = clone $message1;
     $message2->addPart($textPart);
     $this->message->setBody(array($message1, $message2, 'text/plain' => $emptPart));
     $body = $this->message->getBody();
     $this->assertInstanceOf('Zend\\Mime\\Message', $body);
     $this->assertMimeMessages(array('multipart/mixed' => $message2->generateMessage(\Zend\Mail\Headers::EOL), 'text/html' => 'simple <b>html</b>', 'text/plain' => 'simple text alternative'), $body);
 }