Set the summary for this content element.
public setSummary ( string $summary ) : Horde_Push | ||
$summary | string | The summary. |
return | Horde_Push | This content element. |
public function testToConfiguredHeader() { $factory = new Horde_Push_Factory_Recipients(); $recipients = $factory->create(array(), array('recipients' => array('mail-me'), 'recipient' => array('mail-me' => array('type' => 'mail', 'acl' => '*****@*****.**', 'mailer' => array('type' => 'mock', 'from' => '*****@*****.**'))))); $push = new Horde_Push(); $push->setSummary('E-MAIL'); foreach ($recipients as $recipient) { $push->addRecipient($recipient); } $result = $push->push(array('pretend' => true)); $this->assertContains('to: recipient@example.com', $result[0]); }
public function testFluidSummary() { $push = new Horde_Push(); $this->assertInstanceOf('Horde_Push', $push->setSummary('SUMMARY')); }
/** * Generate a Horde_Push element based on the provided data. * * @param array $data The data to be pushed. * * @return Horde_Push The element to be pushed. */ private function _createFromData($data) { if (!isset($data['summary'])) { throw new Horde_Push_Exception('Data is lacking a summary element!'); } $push = new Horde_Push(); $push->setSummary($data['summary']); if (isset($data['body'])) { if (htmlspecialchars($data['body']) != $data['body']) { $push->addContent($data['body'], 'text/html'); } else { $push->addContent($data['body']); } } if (isset($data['tags'])) { foreach ($data['tags'] as $tag) { $push->addTag($tag); } } if (isset($data['references'])) { foreach ($data['references'] as $reference) { $push->addReference($reference); } } return $push; }