1: <?php
2: /**
3: * A mock recipient.
4: *
5: * PHP version 5
6: *
7: * @category Horde
8: * @package Push
9: * @author Gunnar Wrobel <wrobel@pardus.de>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11: * @link http://www.horde.org/libraries/Horde_Push
12: */
13:
14: /**
15: * A mock recipient.
16: *
17: * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If you did not
20: * receive this file, see http://www.horde.org/licenses/lgpl21.
21: *
22: * @category Horde
23: * @package Push
24: * @author Gunnar Wrobel <wrobel@pardus.de>
25: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
26: * @link http://www.horde.org/libraries/Horde_Push
27: */
28: class Horde_Push_Recipient_Mock
29: extends Horde_Push_Recipient_Base
30: {
31: /**
32: * Pushed content elements.
33: *
34: * @var array
35: */
36: public $pushed = array();
37:
38: /**
39: * Push content to the recipient.
40: *
41: * @param Horde_Push $content The content element.
42: * @param array $options Additional options.
43: *
44: * @return NULL
45: */
46: public function push(Horde_Push $content, $options = array())
47: {
48: $this->pushed[] = $content;
49: if (empty($options['pretend'])) {
50: return sprintf('Pushed "%s".', $content->getSummary());
51: } else {
52: return sprintf('Would push "%s".', $content->getSummary());
53: }
54: }
55: }
56: