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


PHP Twig_Environment::send方法代码示例

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


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

示例1: testSendingMailWorks

 public function testSendingMailWorks()
 {
     $message = new ParsedMessage();
     $message->setFrom('from@addr.com', 'from');
     $message->setReplyTo('reply@addr.com');
     $message->addTo('to1@addr.com', 'to1');
     $message->addTo('to2@addr.com', 'to2');
     $message->addCc('cc1@addr.com', 'cc1');
     $message->addCc('cc2@addr.com', 'cc2');
     $message->addBcc('bcc1@addr.com', 'bcc1');
     $message->addBcc('bcc2@addr.com', 'bcc2');
     $message->setSubject('_subject');
     $message->setMessageText('_text_message');
     $message->setMessageHtml('_html_message');
     $this->mailer->send(Argument::type(\Swift_Message::class))->shouldBeCalled();
     $closureExceuted = false;
     $this->fixture->send($message, function (\Swift_Message $message) use(&$closureExceuted) {
         // from
         $this->assertEquals(['from@addr.com' => 'from'], $message->getFrom());
         // reply-to
         $this->assertEquals(['reply@addr.com' => null], $message->getReplyTo());
         // to
         $this->assertEquals(['to1@addr.com' => 'to1', 'to2@addr.com' => 'to2'], $message->getTo());
         // cc
         $this->assertEquals(['cc1@addr.com' => 'cc1', 'cc2@addr.com' => 'cc2'], $message->getCc());
         // bcc
         $this->assertEquals(['bcc1@addr.com' => 'bcc1', 'bcc2@addr.com' => 'bcc2'], $message->getBcc());
         $this->assertEquals('_subject', $message->getSubject());
         $this->assertEquals('_text_message', $message->getBody());
         $closureExceuted = true;
     });
     $this->assertTrue($closureExceuted, 'closure was not executed.');
 }
开发者ID:sgomez,项目名称:SystemMailBundle,代码行数:33,代码来源:SwiftMailerTest.php


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