ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
mock.php
Go to the documentation of this file.
1 <?php
52 class Mail_mock extends Mail {
53 
60  var $sentMessages = array();
61 
68 
75 
87  function Mail_mock($params)
88  {
89  if (isset($params['preSendCallback']) &&
90  is_callable($params['preSendCallback'])) {
91  $this->_preSendCallback = $params['preSendCallback'];
92  }
93 
94  if (isset($params['postSendCallback']) &&
95  is_callable($params['postSendCallback'])) {
96  $this->_postSendCallback = $params['postSendCallback'];
97  }
98  }
99 
125  function send($recipients, $headers, $body)
126  {
127  if ($this->_preSendCallback) {
128  call_user_func_array($this->_preSendCallback,
129  array(&$this, $recipients, $headers, $body));
130  }
131 
132  $entry = array('recipients' => $recipients, 'headers' => $headers, 'body' => $body);
133  $this->sentMessages[] = $entry;
134 
135  if ($this->_postSendCallback) {
136  call_user_func_array($this->_postSendCallback,
137  array(&$this, $recipients, $headers, $body));
138  }
139 
140  return true;
141  }
142 
143 }