本文整理汇总了PHP中Notifier::createSend方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifier::createSend方法的具体用法?PHP Notifier::createSend怎么用?PHP Notifier::createSend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notifier
的用法示例。
在下文中一共展示了Notifier::createSend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateUsingArrayAttributes
public function testCreateUsingArrayAttributes()
{
$n = new Notifier();
$result = $n->createSend(User::find(1));
// result has both headers/body
$this->assertContains('Date:', $result);
$this->assertContains('Dear Mike,', $result);
$this->assertEquals('derek@maintainable.com, Mike Naberezny <mike@maintainable.com>', $n->getRecipients());
$this->assertEquals('Confirmation for Mike', $n->getSubject());
$this->assertContains('From: test@example.com', $n->getHeaders());
$this->assertContains('Cc: test1@example.com, test2@example.com', $n->getHeaders());
$this->assertContains('Bcc: test3@example.com, test4@example.com', $n->getHeaders());
$this->assertContains('Mime-Version: 1.0', $n->getHeaders());
$this->assertContains('Organization: Maintainable, LLC', $n->getHeaders());
// body
$this->assertContains('Content-Type: text/plain; charset="utf-8"', $n->getBody());
$this->assertContains('Dear Mike,', $n->getBody());
$this->assertContains('http://maintainable.com', $n->getBody());
}