2020-09-22 20:48:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Test\Util;
|
|
|
|
|
|
|
|
use Friendica\Util\Emailer;
|
|
|
|
|
|
|
|
class EmailerSpy extends Emailer
|
|
|
|
{
|
|
|
|
public static $MAIL_DATA;
|
|
|
|
|
2020-10-18 18:31:57 +00:00
|
|
|
/**
|
|
|
|
* Wrapper around the mail() method (mainly used to overwrite for tests)
|
|
|
|
* @see mail()
|
|
|
|
*
|
|
|
|
* @param string $to Recipient of this mail
|
|
|
|
* @param string $subject Subject of this mail
|
|
|
|
* @param string $body Message body of this mail
|
|
|
|
* @param string $headers Headers of this mail
|
|
|
|
* @param string $parameters Additional (sendmail) parameters of this mail
|
|
|
|
*
|
|
|
|
* @return bool true if the mail was successfully accepted for delivery, false otherwise.
|
|
|
|
*/
|
2020-09-22 20:48:34 +00:00
|
|
|
protected function mail(string $to, string $subject, string $body, string $headers, string $parameters)
|
|
|
|
{
|
|
|
|
self::$MAIL_DATA = [
|
|
|
|
'to' => $to,
|
|
|
|
'subject' => $subject,
|
|
|
|
'body' => $body,
|
|
|
|
'headers' => $headers,
|
|
|
|
'parameters' => $parameters,
|
|
|
|
];
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|