本文整理汇总了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.');
}