Changeset 33124 for trunk/tests/phpunit/includes/mock-mailer.php
- Timestamp:
- 07/08/2015 05:15:02 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/mock-mailer.php
r27385 r33124 5 5 var $mock_sent = array(); 6 6 7 function preSend() { 8 $this->Encoding = '8bit'; 9 return parent::preSend(); 10 } 11 7 12 /** 8 * Override send() so mail isn't actually sent.13 * Override postSend() so mail isn't actually sent. 9 14 */ 10 function send() { 11 try { 12 if ( ! $this->preSend() ) 13 return false; 15 function postSend() { 16 $this->mock_sent[] = array( 17 'to' => $this->to, 18 'cc' => $this->cc, 19 'bcc' => $this->bcc, 20 'header' => $this->MIMEHeader, 21 'body' => $this->MIMEBody, 22 ); 14 23 15 $this->mock_sent[] = array( 16 'to' => $this->to, 17 'cc' => $this->cc, 18 'bcc' => $this->bcc, 19 'header' => $this->MIMEHeader, 20 'body' => $this->MIMEBody, 21 ); 22 23 return true; 24 } catch ( phpmailerException $e ) { 25 return false; 26 } 24 return true; 27 25 } 28 26 }
Note: See TracChangeset
for help on using the changeset viewer.