/**
  *
  */
 public function testInstanceWrapped()
 {
     $wrappedMessage = TesterWrappedMessage::getValid();
     $newMessage = MailWrappedMessage::newInstance($wrappedMessage);
     $this->assertInstanceOf('BespokeSupport\\MailWrapper\\MailWrappedMessage', $newMessage);
     $this->assertNull($newMessage->getWrappedMessage());
     $this->assertNull($newMessage->getMessage());
     $this->assertCount(2, $wrappedMessage->getToRecipients());
     $this->assertCount(2, $wrappedMessage->getCcRecipients());
     $this->assertCount(2, $wrappedMessage->getBccRecipients());
 }
 /**
  *
  */
 public function testValidTo()
 {
     $transport = new TesterTransportMailgunNull('TEST', 'example.com');
     $wrappedMessage = TesterWrappedMessage::getValid();
     $message = MessageTransformerMailgun::fromWrappedMessage($wrappedMessage, $transport);
     $this->assertInstanceOf('BespokeSupport\\MailWrapper\\MailgunMessage', $message);
     $this->assertCount(2, $message->getMessage()['to']);
     $this->assertCount(2, $message->getMessage()['cc']);
     $this->assertCount(2, $message->getMessage()['bcc']);
     $this->assertGreaterThan(0, strlen($message->getMessage()['subject']));
     $this->assertGreaterThan(0, strlen($message->getMessage()['text']));
     $this->assertGreaterThan(0, strlen($message->getMessage()['html']));
     $this->assertEquals(2, $message->getRecipientCount('to'));
     $this->assertEquals(2, $message->getRecipientCount('cc'));
     $this->assertEquals(2, $message->getRecipientCount('bcc'));
 }
 /**
  *
  */
 public function testValidTo()
 {
     $wrappedMessage = TesterWrappedMessage::getValid();
     $message = MessageTransformerPhpMailer::fromWrappedMessage($wrappedMessage);
     $this->assertInstanceOf('\\PHPMailer', $message);
     $this->assertCount(2, $message->getToAddresses());
     $this->assertCount(2, $message->getCcAddresses());
     $this->assertCount(2, $message->getBccAddresses());
     $this->assertGreaterThan(0, strlen($message->Subject));
     $this->assertGreaterThan(0, strlen($message->Body));
     $this->assertGreaterThan(0, strlen($message->AltBody));
 }
示例#4
0
 /**
  *
  */
 public function testValidTo()
 {
     $wrappedMessage = TesterWrappedMessage::getValid();
     $message = MessageTransformerZend::fromWrappedMessage($wrappedMessage);
     $this->assertInstanceOf('Zend\\Mail\\Message', $message);
     $this->assertCount(2, $message->getTo());
     $this->assertCount(2, $message->getCc());
     $this->assertCount(2, $message->getBcc());
     $this->assertGreaterThan(0, strlen($message->getSubject()));
     $this->assertGreaterThan(0, strlen($message->getBody()));
 }
 /**
  *
  */
 public function testSendMerge()
 {
     $message = TesterWrappedMessage::getValid();
     $transport = new TesterTransportPhpMailerNull(true);
     MailManagerSendPhpMailer::send($transport, $message);
 }