当前位置: 首页>>代码示例>>PHP>>正文


PHP Swift_Message::getContentType方法代码示例

本文整理汇总了PHP中Swift_Message::getContentType方法的典型用法代码示例。如果您正苦于以下问题:PHP Swift_Message::getContentType方法的具体用法?PHP Swift_Message::getContentType怎么用?PHP Swift_Message::getContentType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Swift_Message的用法示例。


在下文中一共展示了Swift_Message::getContentType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createMessage

 /**
  * @param Swift_Message $message
  *
  * @return Swift_Message
  */
 protected function createMessage(Swift_Message $message)
 {
     $mimeEntity = new Swift_Message('', $message->getBody(), $message->getContentType(), $message->getCharset());
     $mimeEntity->setChildren($message->getChildren());
     $messageHeaders = $mimeEntity->getHeaders();
     $messageHeaders->remove('Message-ID');
     $messageHeaders->remove('Date');
     $messageHeaders->remove('Subject');
     $messageHeaders->remove('MIME-Version');
     $messageHeaders->remove('To');
     $messageHeaders->remove('From');
     return $mimeEntity;
 }
开发者ID:NivalM,项目名称:VacantesJannaMotors,代码行数:18,代码来源:SMimeSigner.php

示例2: getContentType

 /**
  * {@inheritdoc}
  */
 public function getContentType()
 {
     return $this->message->getContentType();
 }
开发者ID:cawaphp,项目名称:email,代码行数:7,代码来源:Message.php

示例3: testMimeTypeIsMixed

 /**
  * The multipart/mixed content-type is more significant than multipart/related.
  */
 public function testMimeTypeIsMixed()
 {
     $msg = new Swift_Message();
     $msg->attach(new Swift_Message_Part("foo"));
     $this->assertEqual("multipart/alternative", $msg->getContentType());
     $msg->attach(new Swift_Message_EmbeddedFile("bar"));
     $this->assertEqual("multipart/related", $msg->getContentType());
     $msg->attach(new Swift_Message_Attachment("zip"));
     $this->assertEqual("multipart/mixed", $msg->getContentType());
     $msg->attach(new Swift_Message_EmbeddedFile("button"));
     $this->assertEqual("multipart/mixed", $msg->getContentType());
 }
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:15,代码来源:TestOfMessage.php

示例4: assertSendCalled

 /**
  * @param string         $templateName
  * @param array          $templateParams
  * @param \Swift_Message $expectedMessage
  * @param string         $emailType
  */
 protected function assertSendCalled($templateName, array $templateParams, \Swift_Message $expectedMessage, $emailType = 'txt')
 {
     $this->emailTemplate->expects($this->once())->method('getType')->willReturn($emailType);
     $this->objectRepository->expects($this->once())->method('findOneBy')->with(['name' => $templateName])->willReturn($this->emailTemplate);
     $this->renderer->expects($this->once())->method('compileMessage')->with($this->emailTemplate, $templateParams)->willReturn([$expectedMessage->getSubject(), $expectedMessage->getBody()]);
     $to = $expectedMessage->getTo();
     $toKeys = array_keys($to);
     $this->emailHolderHelper->expects($this->once())->method('getEmail')->with($this->isInstanceOf('Oro\\Bundle\\UserBundle\\Entity\\UserInterface'))->willReturn(array_shift($toKeys));
     $this->mailer->expects($this->once())->method('send')->with($this->callback(function (\Swift_Message $actualMessage) use($expectedMessage) {
         $this->assertEquals($expectedMessage->getSubject(), $actualMessage->getSubject());
         $this->assertEquals($expectedMessage->getFrom(), $actualMessage->getFrom());
         $this->assertEquals($expectedMessage->getTo(), $actualMessage->getTo());
         $this->assertEquals($expectedMessage->getBody(), $actualMessage->getBody());
         $this->assertEquals($expectedMessage->getContentType(), $actualMessage->getContentType());
         return true;
     }));
 }
开发者ID:Maksold,项目名称:platform,代码行数:23,代码来源:AbstractProcessorTest.php


注:本文中的Swift_Message::getContentType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。